I am currently developing an alarm app, and I’ve noticed that apps like Super Alarm and Alarmy are able to send local push notifications every 3 seconds after a specified time, even when the app is completely closed and in Airplane Mode. The notifications continue until the user opens the app. I’m trying to implement this functionality, but I haven’t been able to figure out how. Could anyone provide guidance on how to achieve this?
Help Needed: Repeated Local Notifications for Alarm App When App is Closed
First, to clarify, there are Local notifications or Push notifications. Not sure by which you mean to use when you say ”local push” notificactions. [There is such a thing as Local Push Connectivity for sending push notifications in a closed local network, but I suppose you are not asking about that].
Assuming you mean local notifications, the UserNotifications API does not have a facility to schedule local notifications in an arbitrary future time, and then have it repeated on a different schedule. For example, if you want to set an alarm at 8am tomorrow and then repeat it every minute, this is not doable by scheduling a single notification.
You would need to schedule separate notifications for the start time (although you can set that to repeat on the same schedule, like “8am every day”). And then set separate notifications for the repeat. You can schedule up to 20 notifications at one time.
As for the apps you claim are doing this, we do not know what it is they are doing which you might be interpreting as local notification, nor we would be able to discuss their techniques with you even if we did know.
Argun Tekant / DTS Engineer / Core Technologies