iOS: onRegister only called with requestPermissions: true
See original GitHub issueHey,
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:
- Created 4 years ago
- Reactions:11
- Comments:18 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can’t seem to get
onRegister
to trigger at all.I am running into this same issue. Has anyone found a cause, or better yet, a solution?