ios - All notifications disappearing after opening one of them -
i have server sends me push notifications , let's have 5 notifications on phone. if open 1 of them other notifications disappears. want 1 clicked disappear.
this how 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 view controller } application.applicationiconbadgenumber = 0 }
by setting applicationiconbadgenumber
0
, remove every notification notification center.
this has been discussed here: ios application: how clear notifications?
furthermore, not possible programmatically remove single notification, ios8 on, os handle when user taps single notification. has been discussed here: remove single remote notification notification center
Comments
Post a Comment