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.

[ios] onRegister doesn't execute

See original GitHub issue

I see the “allow/deny” popup when I request permissions,

PushNotification.requestPermissions();

but the config binding never executes…

    PushNotification.configure({
      onRegister: function(token) {
        console.log( 'TOKEN:', token );
      },

if I choose allow, I can schedule a notification, and it works:

  PushNotification.localNotificationSchedule({
          message: "Test Reminder", // (required)
          date: new Date(Date.now() + (60 * 1000)) // in 60 secs
        });

Any thoughts would be greatly appreciated…

PS. I know the example code is incomplete…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

12reactions
atebitcommented, Mar 29, 2017

Simple fix that I missed.

Push toggle in capabilities settings… derp.

screen shot 2017-03-28 at 8 05 23 pm
2reactions
atebitcommented, Jul 28, 2017

Yes, wont’ show on simulator because it has no device token.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native onRegister event not working (iOS)
I've tried to have the PushNotification. config in both a state as well as completely outside of the React component lifecycle, both are...
Read more >
Implementing Push Notifications in iOS using React Native
The reason being that, on iOS, the FCM token which we receive in the “onRegister” doesn't work. The “firebase.messaging().getToken” method returns a token ......
Read more >
react-native-push-notification - npm
Start using react-native-push-notification in your project by running ... Token is generated (iOS and Android) onRegister: function (token) ...
Read more >
Implementing React Native Push Notifications in Android Apps
For iOS devices, this library depends on the manual installation instructions ... Start by importing PushNotification from the library you ...
Read more >
Push Notifications in React Native & iOS (Client & Server Setup!)
Doesn't seem too useful in the long run, but definitely a good place for us to ... onRegister: function(token) { // We will...
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