I want to get my token...
Thanks!
I'm also running into a similar issue.
I _think_, based on reading the source code, that you must call PushNotification.requestPermissions() and wait for the onRegister callback to fire with the token.
I haven't gotten this working yet due to some other setup issues, but I'm betting that's the way. Please let me know if you get that working.
Aha! I think that works. Use PushNotification.requestPermissions(), and that will (eventually, if you have the senderID, etc. set-up correctly) fire onRegister with the token.
requestPermissions() is only for iOS, right? My onRegister doesn't seem to be called on Android.
@swescot requestPermissions() is for both iOS and Android. When using on Android remember to set senderID to you project name - you can find this on your Google developer console.
I did that with no success, @ianlin. However when I set it to my project number it worked :)
Cool, yeah I was trying to say that :p Glad it worked!
im having same issue OnRegister method never firing, i have a principal component then in componentDidMount event i set PushNotification.configure() ... with senderID but onRegister method never return a token....
PushNotification.requestPermissions() with correct senderID did not help me either
Same issue, Android & iOS. Local notification work's well, react 15.3.2 / rn 0.37.0 / react-native-push-notifications 2.2.1
Please make sure you go all the manual installation steps for this repo for your current RN version.
Mine started to work all of a sudden. I believe I was missing some lines from the manual installation instructions and when I went over and added the missing lines it just worked.
Do remember remote push notification works ONLY ON REAL DEVICE and not on emulators or simulators.
@narek11
Yeah, seem its work! Thank you and @zo0r
@narek11 can you remember what it was that's missing?
@npomfret can't recall exactly but I did went through the install instructions for my version which is here:
https://github.com/zo0r/react-native-push-notification/blob/a359e5c00954aa324136eaa9808333d6ca246171/README.md
I also remember downgraded gradle but not sure if that was the issue
https://gist.github.com/narek11/43a04a1b00c049af9997e94dd28d0773
@narek11 @eladcandroid @cinder92 Please add following permissions in AndroidMenifest.xml.
/< uses-permission android:name="android.permission.INTERNET" / >
< uses-permission android:name="android.permission.WAKE_LOCK" / >
< permission android:name="
< uses-permission android:name="
< uses-permission android:name="android.permission.VIBRATE" / >
< uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" / >
Most helpful comment
im having same issue OnRegister method never firing, i have a principal component then in componentDidMount event i set PushNotification.configure() ... with senderID but onRegister method never return a token....