0

I am creating an library meant to be used on other apps and that will receive it's own Firebase message from a separate sender. I got two Firebase token token, one for the app I am using to test the sdk, and the other for the sdk, using different senderID I created

String token_app = FirebaseInstanceId.getInstance().getToken();
String token_sdk = FirebaseInstanceId.getInstance().getToken(<my-sdk-project-id>, FirebaseMessaging.INSTANCE_ID_SCOPE);

On the Firebase Console, I tried to test those token by sending message to them. When I send a message from that app project, using the token_app, I receive notification and data as expected.

However, when I try with my sdk project, with the token_sdk, I do not receive anything. The notification is sent from the console, without error, but the device do not receive anything, with tha app itself either in the foreground or in the background.

Is there something special to do to receive message from multiple sender? The Firebase doc do not go deep into the subject.

AL.
  • 36,815
  • 10
  • 142
  • 281
Laetan
  • 879
  • 9
  • 26
  • Have you seen these posts : http://stackoverflow.com/a/37981412/4625829, http://stackoverflow.com/q/39045592/4625829, http://stackoverflow.com/q/30772201/4625829 ? – AL. Sep 22 '16 at 09:57
  • 1
    Yes I did. All of them. But i cannot tinker with the google-service file since this is supposed to be an library for external apps. That would probably be a very bad idea security-wise, and tinkering with this file is probably not within everyone grasp. I doubt FCM was designed to force us to do that. – Laetan Sep 22 '16 at 10:04

1 Answers1

0

You should use the Sender ID of your project to send, not your "sdk-project-id".

Firebase Console

Tohure
  • 128
  • 1
  • 9