Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_messaging] I can't remove incoming Firebase notifications programmatically #766

Closed
kroikie opened this issue Oct 13, 2019 · 4 comments
Labels

Comments

@kroikie
Copy link
Collaborator

kroikie commented Oct 13, 2019

I have an incoming Firebase notification coming to my phone and if the user does not tap on it and the user re-opens the app, I want the Android notification to be removed programmatically by tag received from the notification payload.

I have used the Firebase_messaging "^1.0.3" Flutter plugin and the MessageHandler for incoming message works.
Inspecting Firebase Notification from StatusBarNotification I noticed the id_notification is always 0 while the tag is the one sent.

To remove the notification from StatusBar programmatically I have used a platform channel:

private boolean removeNotification(String tag, int idNotifica) {
boolean result = false;
NotificationManager notifManager= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notifManager.cancel(tag, idNotifica);
//notifManager.cancelAll(); --- it doesn't work too
result = true;
return result;
}

but the notification can't be removed.

@kroikie
Copy link
Collaborator Author

kroikie commented Oct 13, 2019

@faspadaro

The issue at flutter/flutter#19076 has been closed and moved here. Future collaboration on this issue will be done here.

@BondarenkoStas BondarenkoStas added type: bug Something isn't working help wanted labels Oct 22, 2019
@BondarenkoStas BondarenkoStas changed the title I can't remove incoming Firebase notifications programmatically [firebase_messaging] I can't remove incoming Firebase notifications programmatically Oct 22, 2019
@g-balas
Copy link

g-balas commented Jan 25, 2020

Any news on this ? I can't find a way to remove FCM notification anywhere...

@dhuma1981
Copy link

Any update here?

@kirstywilliams kirstywilliams added plugin: messaging type: enhancement New feature or request and removed help wanted type: bug Something isn't working labels Apr 27, 2020
@Salakar
Copy link
Member

Salakar commented Nov 5, 2020

Hey all 👋

As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues.

If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.

Given the scope of the rework I'm going to go ahead and close this issue in favour of trying out the latest plugin in combination with a local notifications package to dismiss notifications.

Thanks everyone.

@Salakar Salakar closed this as completed Nov 5, 2020
@firebase firebase locked and limited conversation to collaborators Dec 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants