Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All notifications disappearing after opening one of them

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
}
like image 673
Almis Avatar asked May 14 '15 08:05

Almis


People also ask

Why have my notifications disappeared?

Do Not Disturb or Airplane Mode is on. Either system or app notifications are disabled. Power or data settings are preventing apps from retrieving notification alerts. Outdated apps or OS software can cause apps to freeze or crash and not deliver notifications.

How do you stop notifications from disappearing on iPhone?

You can prevent this from happening by setting the notifications as persistent from your settings if that's what you're after. Open the setting app on your iPhone. Select notifications and select the app. Enable persistent notifications.

Why do some iPhone notifications disappear?

Check the Notification Settings It is possible to have notifications disappearing from the lock screen if the notification settings are incorrect. To ensure you can see everything you want, the first thing you need to do when you have this issue is head to Settings>>Notifications.

Why does my notification badge disappear when I open an app?

It's normal for the notification badges to clear on the app's taskbar icon when the app is opened.

How do I turn off notifications on Windows 10 without screen?

Your notifications will now stay longer on the bottom right of your screen before they disappear. Open the Control Panel in Large icons view, and click on Ease of Access Center . Under the “Explorer all settings” section, click on the “ Use the computer without a display ” link.

Why are notifications not showing up on my Android device?

Here are some of the ways to fix it when notifications are not showing up on your Android device. Check That Do Not Disturb is not enabled. It may seem obvious, but forgetting Do Not Disturb is enabled is one of the most common causes for not receiving notifications. If this setting is on (enabled), turn it off, and they will start working again.

How long do Windows 10 notifications stay in the Action Center?

By default, the notifications will pop up for 5 minutes before they are sent off to the Action Center. If you would like the notifications to stay a litter longer, here are 3 ways to change Windows 10 notification duration with ease.


1 Answers

By setting the applicationIconBadgeNumber to 0, you also remove every notification from the notification center.

This has also been discussed here: iOS application: how to clear notifications?

Furthermore, it is not possible to programmatically remove a single notification, but from iOS8 on, the OS will handle this for you when a user taps a single notification. This has also been discussed here: Remove single remote notification from Notification Center

like image 84
Steffen D. Sommer Avatar answered Oct 02 '22 18:10

Steffen D. Sommer