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 the token null

See original GitHub issue

Hi, great package so far.

I have a question which is related with an issue: When i open the app for the first time (after install), the token is not generated. The token is null.

Which is the best approach to get the token if the onRegister method returns token as null? Do i have to recall this function in other screen of the app?

Please help me with some code examples. Maybe something like:

PushNotification.onRegister((token)=>{ console.log(token); });

Thanks, Mihai

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
mikhicommented, Nov 13, 2017

Can someone please advise/help me how to proceed in my case?

1reaction
RobertStuffcommented, Jan 19, 2018

@hugoh1995 Yup its already working… I use Reactotron for logging but somehow it doesn’t show the token… I just see it when I do console.log! I think its an issue on Reactotron… Thanks anyway…

Read more comments on GitHub >

github_iconTop Results From Across the Web

onRegister token null IOS, Android ok #363 - GitHub
I have managed to get the token for iOS and Android devices, but I have a little issue: when I run for the...
Read more >
React Native Push Notification onRegister token is null
My question is, which is the best approach to get the token if the onRegister method returns token as null? Do i have...
Read more >
[Solved]-React Native Push Notification onRegister token is null
This problem was FCM.getAPNSToken() runs right after FCM.requestPermissions() , so application didn't get permissions for push notifications when method runs.
Read more >
Developers - onRegister token null IOS, Android ok - - Bountysource
Platform: IOS, react native v0.40, push notify lastest onRegister = (token) => { token is null } but used PushNotificationIOS.addEventListener('register' ...
Read more >
react-native-push-notification Code Examples - Snyk
... lastTokenRegistration = null; PushNotification.configure({ onRegister: async ... Called when Token is generated (iOS and Android) onRegister: (token) ...
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