onRegister not getting called (Android)
See original GitHub issueI can’t seem to get remote push notifications to work in my app(Android) cause I can’t get the token to fire back to the server. So far have not tried on iOS RN version: 37-39.2 Push notification version: 2.2.0/1
I can fire a local notification and see that the PushNotification.configure has been run since the onNotification callback works, but I don’t get the onRegister callback
In the build.gradle I have tried multiple versions of play-services-gcm, from 8.1.0 to 9.0.1 to 10.0.1 but nothing works. I have placed the PushNotification.configure call right in the beginning of the app, so I should expect to see the registration there?
I am running the code on the device. Can’t seem to figure out what is wrong and there are no error messages thrown.
Build.gradle `dependencies { compile project(‘:react-native-vector-icons’) compile project(‘:react-native-i18n’) compile project(‘:react-native-device-info’) compile project(‘:react-native-config’) compile project(‘:react-native-audio-toolkit’) compile project(‘:react-native-image-crop-picker’) compile project(‘:react-native-photo-view’) compile project(‘:react-native-push-notification’) compile (‘com.google.android.gms:play-services-gcm:8.1.0’) { force = true; }
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use
configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> if (details.getRequested().getGroup() == ‘com.google.android.gms’) { // If different projects require different versions of // Google Play Services it causes a crash on run. // Fix by overriding version for all projects. details.useVersion(‘9.6.1’) } } }`
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
Added correct permissions to AndroidManifest, still not getting a response…
SenderID was the problem… Yes using a real device. Thanks!