Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Background fetch for local notifications

I have 8 medicine local notifications which differ from day to day.

They work fine for one day but I want to fire them everyday. I used BackgroundFetch to reschedule the local notifications every time fetch is executed. But my problem here is that background fetch depends on how often the user uses the app. What if the user doesn't open the app more often Also I didn't want to implement silent notifications because it will not wake up the app if the user does not have internet connection. what approach should I use instead of background fetch?

EDIT:

I also thought about location updates in background because my notification times are taken from location of user and calculated accordingly. But will this consume a lot of battery?

like image 461
u_kami Avatar asked Jul 02 '15 10:07

u_kami


1 Answers

Since I've got the same issue in an app that probably does the same stuff as yours, I'd like to share my solution.
It comes with one compromise works only from >=iOS8. By using an interactive notifications you can reschedule your notifications in background, of course the user need to interact with the notification, but I think that if you different actions instead of open the app or cancel the notification is possible to have more interested user.
It's all about creating a configuration with actions.
Here you can find a tutorial.

like image 183
Andrea Avatar answered Oct 08 '22 22:10

Andrea