AlanScottAgain 1 Posted May 3, 2023 (edited) Hi, This is my scenario.... I have an exercise app that will be able to set reminders to do the exercise daily up to 2 times a day. I need to create a notification that will remind the user to the exercise. Taping the reminder should open the app - to record the exercise has been done. The reminders will need to be active after a reboot and work on both Android and iPhone. After reading lots of articles.. I'm completely confused and would like some pointers, Please. Thanks Alan PS it would be good if I could send a notification if the exercise has not been done/logged on the app. Edited May 3, 2023 by AlanScottAgain update title Share this post Link to post
Dave Nottage 557 Posted May 3, 2023 14 hours ago, AlanScottAgain said: The reminders will need to be active after a reboot and work on both Android and iPhone. On Android, for notifications to still work after a reboot, you would need to persist them in some way, and recreate them, *and* have the app start at boot. I have an example of how to have an app that starts at boot, here: https://github.com/DelphiWorlds/Kastri/tree/master/Demos/AndroidStartAtBoot This is a demo from Embarcadero of how to create/send notifications: https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object Pascal/Mobile Snippets/Notifications/SendCancelNotification As discussed above, if you want to recreate the notification at device start you would also need to persist them somehow, e.g. using a database, or perhaps as JSON, read the data and recreate the notifications when the app starts. You would need to handle when a notification is received, so that you remove it from the persisted notifications. On iOS, as far as I know you are out of luck regarding recreating notifications at device start - there does not appear to be anyway for an app to handle this, without the user starting the app. Share this post Link to post
AlanScottAgain 1 Posted May 4, 2023 Thank you David, Do I need to create a service app to read the data and recreate the notification after start up? Would that work on iOS? Share this post Link to post