luke2012 Well-Known Member Licensed User Longtime User Apr 3, 2014 #1 Hi @Erel. I'm using the StartServiceAt in order to schedule a notification in an specifica range (for example : 1 time in a month). The problem happen when the user restart the smartphone because the service is set to start at boot and the notification appears before the scheduled time. My target is to activate the notification only on the defined schedule time not at the system boot. Any solution about it?
Hi @Erel. I'm using the StartServiceAt in order to schedule a notification in an specifica range (for example : 1 time in a month). The problem happen when the user restart the smartphone because the service is set to start at boot and the notification appears before the scheduled time. My target is to activate the notification only on the defined schedule time not at the system boot. Any solution about it?
DonManfred Expert Licensed User Longtime User Apr 3, 2014 #2 write the time you want to start the service in a keyvaluestore too when setting the StartServiceAt On servicestart you can check if the wanted time you stored is reached or not... If not, do nothing. If yes do the things you need to do. Then setup the next start (also write the new wanted time to you keyvalue) Something like this it should be i suppose. But i dont know whether this is the right things to do.. Maybe @Erel can say more about it!? Upvote 0
write the time you want to start the service in a keyvaluestore too when setting the StartServiceAt On servicestart you can check if the wanted time you stored is reached or not... If not, do nothing. If yes do the things you need to do. Then setup the next start (also write the new wanted time to you keyvalue) Something like this it should be i suppose. But i dont know whether this is the right things to do.. Maybe @Erel can say more about it!?
Erel B4X founder Staff member Licensed User Longtime User Apr 3, 2014 #3 I agree with @DonManfred. You should also make your app start at boot. This way you can schedule it again after a restart. Upvote 0
I agree with @DonManfred. You should also make your app start at boot. This way you can schedule it again after a restart.
luke2012 Well-Known Member Licensed User Longtime User Apr 5, 2014 #4 Thaks for the suggestions! Upvote 0