Closed ullfindsmit closed 1 year ago
undefined is what the register method returns, that's not a bug
if you are not receiving the push notification token it's probably some misconfiguration in your app
Make sure you added push capabilities and this two methods in your AppDelegate.swift as explained in the docs
Also add the registrationError
event listener as if it's failing to register, it will provide more information about what the problem is.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
Platform(s)
iOS
Current Behavior
When calling the following code, get the message below and register event not fired.
await PushNotifications.register();
⚡️ [log] - Sat Jun 24 2023 00:10:43 GMT-0700 (Pacific Daylight Time) - Type: All - Message: native ⚡️ To Native -> PushNotifications checkPermissions 81213826 ⚡️ TO JS {"receive":"prompt"} ⚡️ To Native -> PushNotifications requestPermissions 81213827 ⚡️ TO JS {"receive":"granted"} ⚡️ To Native -> PushNotifications register 81213828 ⚡️ TO JS undefined
Expected Behavior
The registration even would be fired.
Code Reproduction
Other Technical Details
npm --version 9.5.1 node --version v18.16.0 pod --version 1.12.1
Additional Context
None