I subscribed to a FCM topic, then unsubscribed to it, and my test device keeps receiving the notifications targetting this topic
From my testing app, I called FirebaseMessaging.getInstance().subscribeToTopic("beta")
to subscribe to a topic called "beta", and after a few hours I found it in the Firebase Console. So far so good.
After that, I unsubscribed to that topic (by calling the unsubscribeToTopic()
method), and the callback was called with a success. To be sure, I also checked that the unsubscription was saved by calling this url with the appropriate token and Authorization
header :
https://iid.googleapis.com/iid/info/{MY_TOKEN}?details=true
As a result, I didn't got any topic in the json response. So... So far so good !
Then, in the Firebase Console, I created a new notification specifying this "beta" (see screenshot below) and clicked on the "Send test message" button (specifying my test device token).
My problem is : I keep receiving this test notification on my test device while I previously unsubscribed to that topic ! What am I doing wrong, any ideas ?
I also tried to target an unexisting topic in the Firebase Console, and I still receive the notification in my test app.
OK, found out what's happening : The test button doesn't take the topic in consideration. So the solution is simple : just publish the notification and try in real life, it will work !