Notifications received even after calling user logout

Hi Support Team,
I have enabled notification extension and added necessary data on the dashboard. I receive notifications for call and chat without any issues.
Now the issue I see is, even after I logout user from cometchat, the app still keeps receiving these notifications for that specific UID.
Also, When I login to another device, how is CometChat handling the update of FCM token internally?

Thanks in advance :slightly_smiling_face:

Hello @Kiran_Flappjacks
Currently, CometChat Pro push notifications work on the topic based mechanism. Thus, on the success of logout method, you will have to unsubscribe all the topics that you have subscribed to to avoid notifications after the user has logged out.
Regarding logging in to another device, you will continue to get the notifications on multiple devices if you subscribe to the topics from multiple devices. You just need to make sure that you unsubscribe to the topics subscribed on logout.

Hope this helps

Thanks for your inputs. I’ve able to progress on the right direction.
Now I see a different issue, Whenever I try to unsubscribe to a topic, I see this in my log -

Failed to retrieve Firebase Instance Id

This is also visible in my logs whenever I try to login using same UID on multiple devices. So basically, the issue hasn’t yet been resolved.
I might be missing out something, looking forward for some more inputs.

So after a lot of debugging, I found the issue to be on the Firebase dependencies.

The below version works without any issues

implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-messaging:20.1.0'

But when I updated to the latest versions I’m facing the issue

implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.google.firebase:firebase-messaging:20.1.2'

For now my issue is resolved, but why the same code does not work with updated dependancies is something to be figured out!

Edit : It seems some compatibility issues with latest release of firebase dependancies. Please let us know the fix for this.

Hi @Kiran_Flappjacks,

This issue is related to the firebase library. We recommend you use a stable firebase library.
It has been fixed in their updated library. You can check the release note in the below link.

https://firebase.google.com/support/release-notes/android

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.