Kashif Hafeez
Kashif Hafeez

Reputation: 51

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

Upvotes: 4

Views: 2775

Answers (1)

Youssef
Youssef

Reputation: 116

You can use FirebaseMessaging.deleteToken();

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

Upvotes: 3

Related Questions