ios - getting local notification while the app is in background -


while app in background didreceivelocalnotification not called.

so try notification didfinishlaunchingwithoptions

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:    (nsdictionary *)launchoptions {   uilocalnotification *notification = [launchoptions  objectforkey:uiapplicationlaunchoptionslocalnotificationkey]; //... } 

but app background mode enable (using external accessory communication) when click on notification, didfinishlaunchingwithoptions not called.

any other way retrieve notification ?

by checking apple's document notifications, says:

ios note: in ios, can determine whether application launched result of user tapping action button or whether notification delivered already-running application examining application state. in delegate’s implementation of application:didreceiveremotenotification: or application:didreceivelocalnotification: method, value of applicationstate property , evaluate it. if value uiapplicationstateinactive, user tapped action button; if value uiapplicationstateactive, application frontmost when received notification.

as far know, when app in background-running state, , there comes local notification, won't receive method call, notification displayed user, if user tap notification , reactive app, receive -didreceivelocalnotification: call.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -