question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onRegister not getting called (Android)

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
atebitcommented, Jul 17, 2017

Added correct permissions to AndroidManifest, still not getting a response…

2reactions
atebitcommented, Jul 17, 2017

SenderID was the problem… Yes using a real device. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] onRegister not called, no permissions requested #910
The problem I am facing is that onRegister never gets called on android (on device and on emulator) which means that there is...
Read more >
React Native onRegister event not working (iOS)
This function never gets called. It doesn't matter if I have requestPermissions:true or not PushNotification.configure({ onRegister: ...
Read more >
How to use the react-native-push-notification.configure ... - Snyk
To help you get started, we've selected a few react-native-push-notification.configure examples, based on popular ways it is used in public projects.
Read more >
onRegistered not called on Android 9.0 Pie : r/androiddev
Finally, a call to GCMRegistrar.register() is made. On every other version of Android, I get a response with a registration token that gets...
Read more >
Push Notifications - Optimizely
onRegister callback will not be called until ... onNotification callback is called when a push notification gets to the phone. By default, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found