Home » Android » android – Google cloud messaging: 100 multiple senders limitation

android – Google cloud messaging: 100 multiple senders limitation

Posted by: admin May 14, 2020 Leave a comment

Questions:

My android application needs to enable GCM push notifications from multiple senders. I’ve read that it is possible here: Receiving messages from multi-senders. However, it is mentioned that there is a limit of 100 multiple senders. In my use-case I might have more than 100 senders (servers with different sender ids and api keys), but each application installed on a device will register to a small number of senders (less than 100).

This is how I need it to work:
1. When the user logs in, the client app will send a rest directly to the app server to get the sender ids which are relevant to that user. The number of possible sender ids is larger than 100, but for a specific user the subset of sender ids which are relevant to that user is probably 1.
2. The client app would execute the following code for each senderId in the set of returned sender ids:

String token = instanceID.getToken(senderId),
            GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);

I want to make sure that the limit of 100 multiple senders doesn’t apply to my use-case. I tried searching more about the limitation, but came up empty.

Thanks in advance!

How to&Answers:

The limit of 100 multiple senders mentioned in [0] refers to senders used by a single instance of your app. Thus your specific use case is supported.

[0] https://developers.google.com/cloud-messaging/concept-options#receiving-messages-from-multi-senders