Jump to content
Sign in to follow this  
AlanScottAgain

Advice, Please - Notifications

Recommended Posts

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 by AlanScottAgain
update title

Share this post


Link to post
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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×