I have a server that sends me push notifications and let's say that I have 5 notifications on my phone. If I open one of them all other notifications disappears. I want only the one clicked to disappear.
This is how I handle receiving notifications:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
if ( application.applicationState == UIApplicationState.Inactive || application.applicationState == UIApplicationState.Background )
{
// navigating user to a view controller
}
application.applicationIconBadgeNumber = 0
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…