ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 208 forks source link

get registrationToken for Node.js #266

Closed reactivize closed 7 years ago

reactivize commented 7 years ago

Hi, I see the api in Java for getting the registration token(s) as.... String refreshedToken = FirebaseInstanceId.getInstance().getToken();

Would you know the api or idiom for retrieving these in Javascript? I don't see a way on the 'firebase' npm module. Thanks!

hypesystem commented 7 years ago

Hi!

You need to get the registration ID on the client, then somehow transmit it to your server, which runs node-gcm and sends notifications to the registration ids.

Are you writing your app in standard Android Studio (Java)? In that case, you should never want to use Javascript to get a reg id.

nguyenlehuutai commented 7 years ago

When you get refreshedToken. you should put token on database firebase.

eladnava commented 7 years ago

Closing due to lack of response. Please reopen if you still need help with this.