b1065579
b1065579

Reputation: 155

Cant unscribe firebase cloud messaging android

Sorry for my english. I try use FCM for my test application, everething work fine i use documentation, and in this documentation write if you want unsubscribe from topik use unsubscribeFromTopic, and i use it like this:

 public void unscribeChannel(final String chanel) {
        FirebaseMessaging.getInstance().unsubscribeFromTopic("/topics/topik" + chanel);
}

but after this nothink happens, I still get notifications( Then i try delete token like this:

  FirebaseInstanceId.getInstance().deleteToken(getToken(), "/topics/topik" + chanel);

but i think it not good and it not help me too

Upvotes: 2

Views: 895

Answers (1)

Hisham Muneer
Hisham Muneer

Reputation: 8742

Just write the topic without slashes, like this :

FirebaseMessaging.getInstance().unsubscribeFromTopic("topic_name_only_no_slashes");

Example :

Example Image

Update:

You can get list of topics of a user using this:

HTTP GET Request

https://iid.googleapis.com/iid/info/<TOKEN>?details=true
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA

Upvotes: 3

Related Questions