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 only called with requestPermissions: true

See original GitHub issue

Hey,

I would like to run PushNotification.configure on app start without immediately requesting permissions from the user, therefore I set requestPermissions to false. However, in this case onRegister never gets called. (Neither do I get an error via PushNotificationIOS.addEventListener). When I set requestPermissions to true, onRegister is called with the token correctly.

So… 1) is this by design? and 2) is there a way to get the token without requesting permissions?

(running on an iPhone XR – real device – with iOS 12.2; the push entitlement is set correctly in Xcode)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
calebpanzacommented, Jul 16, 2019

I can’t seem to get onRegister to trigger at all.

2reactions
nolanrbradycommented, Aug 30, 2019

I am running into this same issue. Has anyone found a cause, or better yet, a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Why isn't a device token being generated?
Prevent requestPermissions called twice if ios result is pending ... This only gets called if I explicitly call PushNotifications.
Read more >
react-native-push-notification Code Examples - Snyk
senderID: 'YOUR GCM SENDER ID', // IOS ONLY (optional): default: all ... (optional) Called when Token is generated (iOS and Android) onRegister: (token) ......
Read more >
Step by Step guide for Implementing Push Notifications in iOS ...
1. PushNotification. · 2. “onRegister” is the event that gets called upon the device's successful registration to the firebase messaging service.
Read more >
Implementing React Native Push Notifications in Android Apps
For iOS devices, this library depends on the manual installation instructions ... popInitialNotification: true, requestPermissions: true }).
Read more >
How To Implement Push Notifications for iOS and Android In ...
(Optional) is called when Token is generated (iOS and Android). `onRegister: ... requestPermissions: true ... required on iOS only.
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