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: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
DR White
Posts: 413
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: 614
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: 413
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: 614
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: 4502
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: 614
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.

Post Reply

Return to “Feature Requests”