Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to terminate notifications when user logout

I integrated Firebase Messaging using local notification in my app, when User A send friend request to User B ,, then User B receives notification. But the problem is when User B logout and User A send friend request to User B then notification also showing to User B even User B is logout.. So basically how can I terminate notifications when user is logout ??

I don't want to show notifications to Logout Users..

Thanks in advance

like image 671
Kashif Hafeez Avatar asked Oct 26 '25 23:10

Kashif Hafeez


1 Answers

You can use FirebaseMessaging.deleteToken();

as shown in this linked https://pub.dev/documentation/firebase_messaging/latest/firebase_messaging/FirebaseMessaging/deleteToken.html

like image 144
Youssef Avatar answered Oct 29 '25 12:10

Youssef



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!