Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove an android push notification from notification center when the app gets started by its launcher icon?

I'd like to remove all pending notifications, if the user starts the app via the launcher icon. This is kind of related to this question (iOS) How to catch all iOS Push Notifications with different user actions including tap on app icon , only that i don't care about any data/info from the notifications.

Is this possible?

(So far i read in the docs, that you can cancel specific notifications. A simple .clearAll() call would be best)

Regards, Richard

like image 223
user1827010 Avatar asked Jul 29 '14 15:07

user1827010


People also ask

What is a ghost push notification?

Tracking uninstalls You send a push campaign to a user. 12 hours later, Iterable sends a "ghost push" (not visible or audible) to that same user. If the app has been uninstalled and the ghost push cannot be delivered, Iterable tracks an uninstall.

Are Android push notifications default?

If a user installs your app on a device that runs Android 13 or higher, your app's notifications are off by default. Your app must wait to send notifications until after you request the new permission and the user grants that permission to your app.


1 Answers

NotificationManager has a clearAll() method that you can call

like image 125
tyczj Avatar answered Nov 08 '22 18:11

tyczj