w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to clear notification in didreceiveremoteNotification method when app running in background?

you could try these two lines which i am always using when receiving a notification

[[UIApplication sharedApplication]
setApplicationIconBadgeNumber: 0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];

setApplicationIconBadgeNumber is a multipurpose property to set the badge number and also clear the notifications





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.