Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know whether a user has subscribed to a topic in FCM?

How to know wether we have already subscriped to a topic in Firebase Cloud Messaging?

like image 575
Manokar Avatar asked Oct 30 '22 01:10

Manokar


1 Answers

You can get token

String token = FirebaseInstanceID.getToken();
Log.d(TAG,token);

and do a Get to https://iid.googleapis.com/iid/info/token

If using curl

curl -X Get -H"Authorization:key=serverAPIkey" "https://iid.googleapis.com/iid/info/token?details=true"

to see all of the device's subscribed topics

Find out details about a client app instance's subscriptions, including each topic name and subscribe date. See get information about app instances

like image 51
Skyler Avatar answered Nov 15 '22 07:11

Skyler