synchronization - Auto-update iPhone content -
i developing enterprise app has lot of dynamic content. there way have app auto update content(new stories, download new videos, etc) @ 3am every sunday.
is possible?
while it’s not possible when app isn’t running, can @ launch or while running (if it’s going running @ 3 am). here’s i’d do:
- store
nsdate
usingnsuserdefaults
last time updated. - at launch, if 3 period has passed since date, initiate sync.
- also @ launch, start
nstimer
long interval—5 minutes or so. @ each firing, check if 3 period has passed , if has, initiate sync. roll last bullet’s codenstimer
’s firing method , run once @ launch. sure updatensdate
object each time. - in application delegate, in methods called returning background, check time , sync if necessary—or start
nstimer
, have fire first.
that should cover of scenarios need update app.
Comments
Post a Comment