Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to copy all the credentials from an Android device to our node server? #20

Open
knissophiliac opened this issue Oct 1, 2018 · 2 comments
Labels

Comments

@knissophiliac
Copy link

knissophiliac commented Oct 1, 2018

I have an another app(not my app) which is running on my phone, and this app's fcm server is sending notifications to my phone. I know the senderId and apiKey of the app and also my phone's pushNotificationId which is set by the app's server.

Can I get the notifications on my node server with this project? I thought I have to copy the credentials that created when the app opened first time and registered to the fcm server of the app to my nodejs push-receiver and start listening with those credentials.

Does it possible to get them from an Android device?

@MatthieuLemoine
Copy link
Owner

Seems like a great use case !

You'll need all the credentials required by push-receiver to listen to incoming notifications:

  • the androidId returned by GCM during registration
  • the securityToken returned by GCM during registration
  • the privateKey to use to decrypt the notifications. The corresponding publicKey was sent to FCM during registration.
  • the authSecret which was generated & sent to FCM during registration

I never did that so I don't know how to retrieve these credentials 😕
The heavy part of the registration process is done by the OS not the application.

The registration logic we use in push-receiver was inspired by the registration process in Chrome. You may have to deep dive into Android source code to find what you want.

@charlie-niekirk
Copy link

All I had to do to receive FCM messages from my app (or another app I suppose) was to call register with my senderId which is in google-services.json. This worked like a treat for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants