Monday 15 February 2010

ios - Handling push notifications when app is not running (App is Killed) -



ios - Handling push notifications when app is not running (App is Killed) -

my problem seems duplicate of this one,but it's not. while application killed , not running in background, if receive force notification , clicked notification banner, works fine. "userinfo" isn't empty , application handles notification. but if dismiss notification banner , open app via clicking application icon, "userinfo" returns nil.

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions: (nsdictionary *)launchoptions { nsdictionary* userinfo = [launchoptions valueforkey:uiapplicationlaunchoptionsremotenotificationkey]; if(userinfo != nil){ //handling notification } }

and also

-(void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler{ if([application applicationstate] == uiapplicationstateactive) { nslog(@"...1"); }else if([application applicationstate] == uiapplicationstateinactive){ nslog(@"...2"); }else if([application applicationstate] == uiapplicationstatebackground){ nslog(@"...2"); } completionhandler(uibackgroundfetchresultnodata); }

is there way handle these notifications or should handle them own ?

no app informed notification used open/launch app.

there no way observe of there notification in notification center app. need build in apps server.

ios objective-c notifications apple-push-notifications

No comments:

Post a Comment