firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.24k stars 566 forks source link

Add API for checking subscription status of a given topic #2641

Open Anigif opened 3 years ago

Anigif commented 3 years ago

It is currently not possible to check whether a user is subscribed to a topic. This would be really nice to have in order to be able to show current state of subscription, for instance with a switch button.

The only current solutions seems to be keeping a state localy (with the risk of it being out of sync) or checking via our own server (which seems counter-intuitive since that's the only Firebase-related thing that would be in the server).

The implementation could just be void isSubscribed(String topic) or List<String> subscribedTopics() depending on what i best for the SDK - both variants can solve the specific issue.

There is a similar feature request in the iOS SDK: firebase/firebase-ios-sdk#225

google-oss-bot commented 3 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

gsiddh commented 1 month ago

Currently we support fetching topic subscriptions for a instance via our server side API: https://developers.google.com/instance-id/reference/server#get_information_about_app_instances

Regarding making this accessible client side via SDK - thanks for that feature request. We will take that into consideration.

Also, if you would like, you can add this as a feature request via fireabse uservoices here: https://firebase.uservoice.com/forums/948424-general?category_id=464872