objective c - launch/wake iOS app periodically -
i have app runs in background. i'd wake periodically: either @ preset times of day or every n hours. must done without user intervention.
i believe since app runs in background, nstimer not work. how can 'wake' app on periodic basis?
of course, that's possible, , easy implement. technique called background fetch. works - 1) inquire operation scheme wake / start application on times. 2) operation scheme decides , periodically start application , calls
-(void)application:(uiapplication *)application performfetchwithcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler
3) jobs there, , can trigger local force notification user, new info available.
here great article covers question
objective-c ios7 nstimer
No comments:
Post a Comment