onRegister function not calling in android
See original GitHub issueI was trying to generate the token in android but the onRegister function wont fire. Did I missing something. here is my code
import React, {Component} from ‘react’; import PushNotification from ‘react-native-push-notification’;
export default class PushController extends Component{ componentDidMount(){ PushNotification.configure({ onRegister: function(token) { console.log( ‘jitender:’, token ); },
onNotification:function(notification){
console.log('NOTIFICATION:', notification);
},
requestPermissions:true,
popInitialNotification:true
})
}
render(){
return null
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
android - GCM onRegistered not calling - Stack Overflow
I have written a code for GCM registration, but I don't know why I'm not getting any callback (onRegistered, onError) of GCMIntentService.
Read more >Step by Step guide for Implementing Push Notifications in iOS ...
Ensure that the push notification feature is enabled. ... (optional) Called when Token is generated (iOS and Android). onRegister: function ...
Read more >Push Notifications - Optimizely
onRegister callback will not be called until ... notification is unfortunately not very strict and is different between iOS and Android.
Read more >react-native-push-notification - npm
PushNotification.configure({ // (optional) Called when Token is generated (iOS and Android) onRegister: function (token) ...
Read more >Implementing React Native Push Notifications in Android Apps
We will be testing out the notification feature on an Android device, ... Called when Token is generated (iOS and Android) onRegister: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thought I’d drop a note here that this issue also arises if – during the android setup – you add the XML snippet (3
<receiver>
s and 2<service>
s) inside of the<activity>
tag like I did on accident -_-. They need to be immediate children to the<application>
.The error that shows up in
logcat
in this scenario is:this occurs on iOS as well