How can I get the GCM_TOKEN?
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'
hey i am getting this while adb logcat GcmAndroid.launchNotification internal', undefined please help
i have tried this but i cant get anything on my console.log . It doesnt show any token . @fermuch
@xphaul are you trying in a device or an emulator?
@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