ios - How to clear notification badge count when reinstall the app -
i have integrated apple push notification ios app. problem when reinstall app, previous notification badge count showing before log in app. how can solve problem? please me.
have tried killing app multitasking menu , launching again?, call here
- (void)applicationdidbecomeactive:(uiapplication *)application { application.applicationiconbadgenumber = 0; }
else
it'll cleared on launching app.
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [[uiapplication sharedapplication] setapplicationiconbadgenumber:0]; return yes; }
choice -2
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { if (launchoptions != nil) { nsdictionary* dict = [launchoptions objectforkey:uiapplicationlaunchoptionsremotenotificationkey]; if (dict != nil) { nslog(@"launched apns: %@", dictionary); [self clearapnsnotifications]; } } return yes; } - (void)application:(uiapplication*)application didreceiveremotenotification:(nsdictionary*)userinfo { nslog(@"received apns : %@", userinfo); [self clearapnsnotifications]; } - (void) clearapnsnotifications { [[uiapplication sharedapplication] setapplicationiconbadgenumber: 0]; [[uiapplication sharedapplication] cancelalllocalnotifications]; }
Comments
Post a Comment