Skip to content

How to get all subscribed topics? #4819

Answered by JoeToeniskoetter
ksetrin asked this question in Q&A
Discussion options

You must be logged in to vote

I believe using this google apis endpoint https://iid.googleapis.com/iid/info/?details=true

Should return a list of subscribed topics regardless of platform (iOS, android) for a particular FCM token.

My suggestion would be to create some server side logic either in a cloud function or Http endpoint that hits this endpoint with your Firebase server key,
To get a list of topics a user is subscribed to, then loops through each subscribed topic and call

admin.messaging().unsubscribeFromTopic(registrationTokens, topic)

Passing in the users FCM token and topic be unsubscribed from.

You can then make a request to this endpoint or cloud function when a user signs out of your application.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@Nashmod
Comment options

@mikehardy
Comment options

@Nashmod
Comment options

@rohan20
Comment options

@mikehardy
Comment options

Answer selected by ksetrin
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
5 participants