Add Repeat option for mobileCreateLocalNotification

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
DR White
Posts: 491
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

Add Repeat option for mobileCreateLocalNotification

Post by DR White » Thu Mar 23, 2017 12:46 pm

Please,

Add Repeat to instruction "mobileCreateLocalNotification command mobileCreateLocalNotification alertBody, alertButtonMessage, alertPayload, alertTime, playSound [, badgeValue]"

Thanks,

David

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 697
Joined: Fri Jun 27, 2008 9:00 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Mikey » Thu Mar 23, 2017 2:53 pm

I don't know if that's even possible, or every game app would do it past a week, but you can certainly loop and schedule a bunch of local notifications into the future, and then each time the app fires up schedule some more, or use push and do it remotely.

DR White
Posts: 491
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

Re: Add Repeat option for mobileCreateLocalNotification

Post by DR White » Thu Mar 23, 2017 3:08 pm

Mikey,

In my current app, I am using a loop to generate a scheduled notification for every hour for seven hours for my events and that works. But, IOS 10 seems to have a 64 local notification limit and so my is limited to eight events, each with seven scheduled notification. If the local notification instruction had a repeat parameter, I could have a lot more events. I researched and some program languages such as below has this capability:

Notification Trigger

Trigger a notification based on time, calendar or location. The trigger can be repeating:

Time interval: Schedule a notification for a number of seconds later. For example to trigger in five minutes:

// Swift
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 300,
repeats: false)

// Objective-C
UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:300
repeats:NO];


Thanks,

David

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 697
Joined: Fri Jun 27, 2008 9:00 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Mikey » Thu Mar 23, 2017 3:20 pm


jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5136
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Add Repeat option for mobileCreateLocalNotification

Post by jacque » Fri Mar 24, 2017 5:16 pm

I don't think scheduling multiple notifications at once is the best way to do it. Instead, schedule only one, and when it arrives, schedule the next one. This way you can set up notifications that repeat indefinitely.

I used this method in an app that had to notify the user every half hour for days on end and it worked well.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 697
Joined: Fri Jun 27, 2008 9:00 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Mikey » Fri Mar 24, 2017 5:52 pm

The problem you have is if the user does not load the app, the next one will never come. That's the drawback to local as opposed to push.

Jim Mac
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 30
Joined: Wed Jun 28, 2006 9:22 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Jim Mac » Thu Aug 08, 2019 6:06 am

Wondering if anyone addressed this. It would be really nice to have a "repeat" option in local notifcatoins. Currently our users can set daily/weekly reminders and when the app opens, it refreshes them out a couple of weeks. That works fine for most people BUT if the user doesn't open the app in that time frame, the notifications "run out".

Some people like the app just for the notifications and aren't really interested in opening the app except when they want to change timing.
Is there a workaround that doesn't involve writing our own external?
I wasn't aware of a limit to the number of allowed notifications. If I know that number, I could schedule notifications out to the maximum # which, if the user only had 4 reminders, might be enough for a few months (16 wks?)

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 697
Joined: Fri Jun 27, 2008 9:00 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Mikey » Thu Aug 08, 2019 11:17 am

You don't need to write an external, you need to push the notifications to the users.
One advantage that has is that you have more control over the process.

Jim Mac
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 30
Joined: Wed Jun 28, 2006 9:22 pm

Re: Add Repeat option for mobileCreateLocalNotification

Post by Jim Mac » Thu Aug 08, 2019 2:50 pm

That'd be the way to go if we were server based. Our current version is strictly local, intentionally. When we add sharing lists, etc among devices, we'll have the ability to use push notifications but not for a while yet.

So, is there a way to simply tag a local notification as repeating. In researching further, it seems like "repeats" is part of UNCalendarNotificationTrigger, not the basic UNNotificationRequest. My guess is Livecode just ignores the "repeats:" parameter.

That means, there's no built in way to do what we need without implementing our own external OR moving to a server based structure.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5136
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Add Repeat option for mobileCreateLocalNotification

Post by jacque » Thu Aug 08, 2019 5:26 pm

You could put in a feature request at quality.livecode.com . Couldn't hurt.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Feature Requests”