Page 1 of 1

Add Repeat option for mobileCreateLocalNotification

Posted: Thu Mar 23, 2017 12:46 pm
by DR White
Please,

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

Thanks,

David

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Mar 23, 2017 2:53 pm
by Mikey
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.

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Mar 23, 2017 3:08 pm
by DR White
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

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Mar 23, 2017 3:20 pm
by Mikey

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Fri Mar 24, 2017 5:16 pm
by jacque
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.

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Fri Mar 24, 2017 5:52 pm
by Mikey
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.

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Aug 08, 2019 6:06 am
by Jim Mac
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?)

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Aug 08, 2019 11:17 am
by Mikey
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.

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Aug 08, 2019 2:50 pm
by Jim Mac
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.

Re: Add Repeat option for mobileCreateLocalNotification

Posted: Thu Aug 08, 2019 5:26 pm
by jacque
You could put in a feature request at quality.livecode.com . Couldn't hurt.