2

On my Android app using Firebase Cloud Messaging, I have found an issue with subscribing to topics when using multiple senders in my google-services.json file.

I get the following error after calling FirebaseMessaging.getInstance().subscribeToTopic("news"):

FirebaseInstanceId: background sync failed: INVALID_PARAMETERS, retry in 10s

If I remove all but one sender from my google-services.json file, I am able to successfully subscribe to a topic and see them sync:

FirebaseInstanceId: topic sync succeeded

I am then able to send topic messages to this app, but then of course I am not able to receive messages from more than one sender.

I have set up the multiple senders in my google-services.json file as per the advice found here on stack overflow (How to put multiple project_number/sender id in google-services.json) and on Google's site (https://developers.google.com/android/guides/google-services-plugin#processing_the_json_file). I've been successfully sending messages to specific registration tokens from multiple sender ids without any trouble up until now. The issue seems to just be with subscribing to topics.

Is there a way to get topic subscription working with multiple senders?

Community
  • 1
  • 1
Nick Komen
  • 21
  • 3
  • Interesting. My answer in that post was only tested by sending to a single registration token. Haven't really tried to test it on topics. I'll look around if I have some time. I think the key to solve this is to find the behavior of `subscribeToTopic` on how it selects the Sender to subscribe to. – AL. Nov 11 '16 at 22:59

0 Answers0