iOS - registerForPushNotifications not resolved.
See original GitHub issuePlugin version: 10.4.0
import * as firebase from 'nativescript-plugin-firebase';
async function register () {
if (!firebase.areNotificationsEnabled()) {
console.log('Attempt to register...');
await firebase.registerForPushNotifications({
showNotifications: true,
showNotificationsWhenInForeground: true
});
console.log('Status', { enabled: firebase.areNotificationsEnabled() });
}
}
Console output:
...
Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (ios)
Installing on device 12345678-90AB-CDEF-1234-567890ABCDEF...
Successfully installed on device with identifier '12345678-90AB-CDEF-1234-567890ABCDEF'.
Successfully transferred all files on device 12345678-90AB-CDEF-1234-567890ABCDEF.
Restarting application on device 12345678-90AB-CDEF-1234-567890ABCDEF...
CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:23: HMR: Hot Module Replacement Enabled. Waiting for signal.
NativeScript debugger has opened inspector socket on port 18183 for com.test.app.
Successfully synced application com.test.app on device 12345678-90AB-CDEF-1234-567890ABCDEF.
CONSOLE LOG file:///node_modules/@nativescript/core/inspector_modules.js:1:12: 'Loading inspector modules...'
CONSOLE LOG file:///node_modules/@nativescript/core/inspector_modules.js:6:12: 'Finished loading inspector modules.'
NativeScript debugger attached.
CONSOLE LOG file:///app/store/notifications.js:5:8: 'Attempt to register...''
The promise never seems to resolve. The prompt itself does appear, and if i restart the app and check again, firebase.areNotificationsEnabled() does return true/false.
Am I doing anything wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
No answer from registerForPushNotifications() on Appcelerator
Try it on a real device, push notification does not work on the iOS Simulator. – danny005. May 3, 2016 at 15:04. Add ......
Read more >Not receiving push device token in… | Apple Developer Forums
Hi there, I'm seeing weird behavior when trying to register for push notifications in macOS development builds for any of my apps
Read more >Push Notification Troubleshooting for iOS - Braze
No push registration prompt. If the application does not prompt you to register for push notifications, there is likely an issue with your...
Read more >iOS notifications missing - Issues / Bugs - Thunkable Community
When you go into iOS Settings > Notifications the app is not listed. ... Make sure to call registerForPushNotifications if you have disabled...
Read more >iOS SDK Setup - OneSignal Documentation
Instructions for adding the OneSignal SDK to your iOS native app with Swift or Objective-C. ... Unless you have a specific reason not...
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 looked into your code and found that the entitlements file is missing. Please also enable push support and copy the entitlements file to App_Resources, as described here.
@Firetrip Have you setup APN certificates / authentication keys? Did you make sure you running on right environment (Development / Release)? Is your device network having any restrictions?
There may not be any issues with Simulator as Push Notification really doesn’t work on Simulator, neither require any configuration there like you do on device.