firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Add API for checking subscription status of a given topic

Open Anigif opened this issue 4 years ago • 2 comments

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

Anigif avatar May 04 '21 10:05 Anigif

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

google-oss-bot avatar May 04 '21 10:05 google-oss-bot

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

gsiddh avatar Jun 06 '24 20:06 gsiddh