1

My app initially used GoogleCloudMessaging.register(String... senderIds). The app has the use-case of having multiple senderids. When this API was deprecated, we migrated to InstanceID #getToken (String authorizedEntity, String scope). We pass authorizedEntity as comma separated sender ids (e.g: senderId1, senderId2). When a new sender id (say senderId3) is to be registered, we call InstanceID#deleteInstanceID() and then call InstanceID #getToken with the new senderId appended, i.e senderId1, senderId2, senderId3. Then server apps corresponding to all senderIds were updated with the new single GCM registration token. This works fine.

Now, when FCM is used, I did the same approach with FirebaseInstanceId#getToken(senderIds, "FCM")and FirebaseInstanceId#deleteInstanceId(). This seems to work fine. But, I would like to get an official confirmation from FCM team if this is good to be used in production.

garnet
  • 551
  • 5
  • 12
  • What does your code look like that doesn't work? Please provide a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) that demonstrates the issue. – Mr.Rebot Sep 06 '18 at 06:26
  • 1
    @Mr.Rebot, as I mentioned in question, the current code "seems to work fine". But, I would like to get a confirmation from Firebase team if it is fine to use the API FirebaseInstanceId#getToken(senderIds, "FCM") the way I am using, because it is not mentioned like that in the javadoc. I already sent a mail to firebase support team and got a reply that they will revert back after consulting FCM experts. – garnet Sep 06 '18 at 14:52
  • Hi garnet! I saw your comment on my answer (the duplicate post) and see it as a fit for duplication. You could still provide an update after you get back to it when the FCM support responds, but for now, I went ahead with closing this post. Feel free to flag it for re-opening after adding more information that you think is different from the other one. Cheers! – AL. Sep 11 '18 at 16:51
  • @AL. Yes, you are right. I found out the duplicate post just yesterday. – garnet Sep 12 '18 at 10:41
  • @ garnet, Any update from firebase support team? – Hey You Sep 22 '18 at 16:00
  • 1
    @HeyYou Quoting response firebase from support team: Just got confirmation from our engineers that multiple senders isn't supported with the InstanceID or FirebaseInstanceId APIs. It looks like our server is returning an old version of the token in these cases as it assumes any requests for multiple senders are GoogleCloudMessaging.register ones. We will be fixing this on our end, but we don't have any ETAs yet on when this would be available. Meanwhile, to get a similar behavior, you should request a different token per sender ID. These won't conflict with each other. – garnet Sep 22 '18 at 18:55
  • 1
    Further clarification from support team when asked about backward compatibility: We have no plans to support multiple senders with the InstanceID or FirebaseInstanceId APIs. We will also work on updating our documentation regarding this to avoid confusion. Thanks for bringing that up. – garnet Sep 22 '18 at 18:57

0 Answers0