I notice that for apps like Google Hangout, Facebook etc. when I get a push notification for any event (people writing on my wall, etc.), if I view the event on my desktop, it will clear the push notification (which I have not cleared myself or opened the app for) on my iPhone.
How can I implement the same?
Right now i'm using this app for implementing my push's.
I customized the above, but the implementation is similar. Do I need to send any special data to the phone to clear all notifications from my app?
Go to Settings and open Notifications. Scroll down and tap on Messages. To disable notifications altogether, toggle off Allow Notifications. To remove badges, turn off the toggle next to Badges.
To remove a persistent notification on Android as fast as possible, first, press-and-hold on it. Alternatively, swipe the notification left or right to reveal a gear icon on either side, and then tap on it. The notification expands. Tap on “Turn off notifications” at the bottom.
I did same in my application that read notifications don't remain in Application. Buts its not how you think it is.
i Saved Remote Notification
in method didReceiveRemoteNotification:
in DataBase (Coredata).
Everytime i was in NotificationViewController
i retrieved from DataBase (Coredata) and when i want to clear them i-e on Reading , deleted that particular Notification form DB.
thats how you should do it.
OR https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW1 Apple says in iOS 7 user can send "silent" push notifications—that is, notifications that do not display alerts or otherwise disturb the user. By receieving this type "silent" in method application:didReceiveRemoteNotification:
do this [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0]; [[UIApplication sharedApplication] cancelAllLocalNotifications];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With