FCM iOS - Remove Older Push Notifcation Tiles when a new Push Notiifcation is recieved

Viewed 693

I have implemented FCM in Xamarin Forms and is working as expected. But I want to remove all the notifications from the notification tray when a new push is received.

I have able to do the same with the Tag key in Android, how to achieve the same on iOS.

Can someone help me with this?

3 Answers
func applicationDidBecomeActive(_ application: UIApplication) {

        UIApplication.shared.applicationIconBadgeNumber = 0 //will remove all badge count
    }

Objective C

 -(void)applicationDidBecomeActive:(UIApplication *)application
{
    application.applicationIconBadgeNumber = 0;
}
Related