i using ios 8 , scheduling uilocalnotification work-around fact cannot execute background code unless finite amount of time or app belongs categories (e.g. communicates external ble accessories, etc.. limited code):
background execution documentation here):
if app in middle of task , needs little time complete task, can call beginbackgroundtaskwithname:expirationhandler: or beginbackgroundtaskwithexpirationhandler: method of uiapplication object request additional execution time.
what want achieve check if there conditions met @ time in uilocalnotification fired (using local notification seems way app execute whilst in background..). unless there way..
unfortunately seem able intercept call , execute code when app enters foreground (users tap notification badge , ** didreceivelocalnotification** gets called.
- (void)application:(uiapplication *)app didreceivelocalnotification:(uilocalnotification *)notif this corresponds behaviour described apple here.
the user taps default button in alert or taps (or clicks) app icon. if default action button tapped (on device running ios), system launches app , app calls delegate’s application:didfinishlaunchingwithoptions: method, passing in notification payload (for remote notifications) or local-notification object (for local notifications). although application:didfinishlaunchingwithoptions: isn’t best place handle notification, getting payload @ point gives opportunity start update process before handler method called.
any idea on how can intercept uilocalnotification whilst app in background , execute code without having user tap on notification?
you cannot use firing of local notification in launch app in background. have noted, app executes if user taps notification.
you can use remote notification content-available key launch application in background.
Comments
Post a Comment