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

FR: Add API for checking subscription status of a given topic

Open js opened this issue 6 years ago • 29 comments

In order to show users a list of subscribed topics (eg UI with the ability to remove active subscriptions) we have to do one of two things today:

  • implement a shadow storage of active subscriptions (in Firebase DB or elsewhere), with all the potential for sync-misshaps
  • implement the instance ID API and have the app query our server, which then queries Googles servers, resulting in more latency, server maintenance/dev overhead

I sorely miss a Messaging.messaging().isSubscribed(to: topic) like API in the FCM SDK for checking whether a topic is currently subscribed to by the current user

js avatar Aug 31 '17 06:08 js

Hi @js! Agreed it would be nice to have that in the SDK. There is a REST API to request this, it currently requires your API Key to perform that check, which the SDK doesn't have.

rsattar avatar Aug 31 '17 17:08 rsattar

+1

hixfield avatar Aug 16 '18 09:08 hixfield

+1

FDREAL avatar Sep 26 '18 21:09 FDREAL

This is the main reason my company stays away from topics on the client side. I'd love to see an update on this!

casperzandbergenyaacomm avatar Nov 08 '18 10:11 casperzandbergenyaacomm

As rsattar stated, you can use the REST API to request this, currently we don't have plan providing such API as exposing your API key in the client would expose it to the public and allow anyone to send messages to the user of that application.

charlotteliang avatar Dec 13 '18 22:12 charlotteliang

@chliangGoogle Totally agreed that "exposing your API key in the client would expose it to the public", that's why this issue has been raised to create a new API while will let the client query for the subscription status of any given topic, or more precisely the list of all active subscriptions for the given device.

Right now the device has the ability to subscribe and unsubscribe from topics, which inherently means that the calls to subscribe/unsubscribe APIs are authenticated using a mechanism that is different from the server API key, so it is only reasonable that the client has the ability to get the list of subscribed topics too.

Please explain the reasoning behind your thinking.

sowdri avatar Jan 03 '19 01:01 sowdri

+1

mpawlo avatar Jul 25 '19 15:07 mpawlo

Thanks @sowdri for explaining the request. Yes if a solution without including a server key would be ideal, we are bringing this request to our team and will let you know with the updates.

charlotteliang avatar Jul 25 '19 17:07 charlotteliang

@chliangGoogle Any updates?

dunyakirkali avatar Aug 28 '19 21:08 dunyakirkali

Should we keep holding out for this, or just assume that it will never be done?

BeauNouvelle avatar Oct 23 '19 01:10 BeauNouvelle

Is there any movement on this (or has anyone come up with an elegant solution)?

KyleGoslan avatar Apr 13 '20 22:04 KyleGoslan

Same here as @KyleGoslan is asking, any movement on this?

Pretty concerning this ticket is from 2017 and there is no movement on it, seems like quite some people need this.

glemmaPaul avatar Apr 17 '20 07:04 glemmaPaul

Thanks for bring this up to our attention, please upvote at the top, and I will bring this to our PM again to see if priority shifts.

charlotteliang avatar Apr 17 '20 17:04 charlotteliang

I need this too.

imannms avatar Jul 14 '20 13:07 imannms

Me too

ziv-li avatar Jul 20 '20 09:07 ziv-li

We need this too. It does make sense to have some thing like this as users can subscribe and unsubscribe. But if the user is not subscribed to a topic, and you call unsubscribe. What will happen. The task should not be successfull that means, you already check if the users is subscribed to a topic before unsubscribing.

ammarbukhari avatar Nov 08 '20 08:11 ammarbukhari

Me too

ma684351 avatar Dec 13 '21 09:12 ma684351

We need this too

marlokessler avatar Jun 05 '22 09:06 marlokessler

We need this too

xiangyangyang avatar Jun 09 '22 06:06 xiangyangyang

Will never happen folks. Give up.

BeauNouvelle avatar Jun 09 '22 07:06 BeauNouvelle

+1

ryaaanb avatar Jul 26 '22 16:07 ryaaanb

+1

chrislangston avatar Jul 30 '22 22:07 chrislangston

me too

taitasu555 avatar Aug 25 '22 06:08 taitasu555

5 years later, still waiting 🤙

mschinis avatar Sep 07 '22 09:09 mschinis

We need to check users' subscriptions because we don`t know if users definitely subscribe or not. we are not going to use this service if no progress

taitasu555 avatar Oct 23 '22 14:10 taitasu555

+1

pinpong avatar Feb 18 '23 08:02 pinpong

This is a deal breaker , please action this

ndlovucn avatar May 24 '23 23:05 ndlovucn

We'd like to have this too!

herrernst avatar May 31 '23 16:05 herrernst

Is this a planned feature @paulb777 ? As I understand it's possible on the android SDK.

zane-carter avatar Apr 06 '24 12:04 zane-carter