Reputation: 155
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
Reputation: 8742
Just write the topic without slashes, like this :
FirebaseMessaging.getInstance().unsubscribeFromTopic("topic_name_only_no_slashes");
You can get list of topics of a user using this:
https://iid.googleapis.com/iid/info/<TOKEN>?details=true
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
Upvotes: 3