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 can I get the GCM_TOKEN? #5

Open
azamuddin opened this issue Jan 28, 2016 · 5 comments
Open

How can I get the GCM_TOKEN? #5

azamuddin opened this issue Jan 28, 2016 · 5 comments

Comments

@azamuddin
Copy link

No description provided.

@fermuch
Copy link

fermuch commented May 15, 2016

Hello. This is an old issue, but if anyone else comes here wondering:

GcmAndroid.addEventListener('register', function(token){
  console.log('send gcm token to server', token);
});

There the token is sent to console.log. You can then see it with:

adb logcat '*:S ReactNative:V ReactNativeJS:V'

@dg92
Copy link

dg92 commented Jun 13, 2016

hey i am getting this while adb logcat GcmAndroid.launchNotification internal', undefined
please help

@xphaul
Copy link

xphaul commented Jul 4, 2016

i have tried this but i cant get anything on my console.log . It doesnt show any token . @fermuch

@fermuch
Copy link

fermuch commented Jul 4, 2016

@xphaul are you trying in a device or an emulator?

@xphaul
Copy link

xphaul commented Jul 5, 2016

@fermuch im on a device . an i got the device token now . My problem is now is that app cant listen on incoming notifications when it is on background state

GcmAndroid.addEventListener('notification', function(notification){ if(!GcmAndroid.isInForeground) { console.log('background') } });

this function doesnt work if app is on background and received a notification

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

No branches or pull requests

4 participants