NativeScript / firebase

Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
https://docs.nativescript.org/plugins/firebase-core.html
Apache License 2.0
56 stars 49 forks source link

The operation couldn't be completed. No APNS token specified before fetching FCM token #253

Closed rayanzaatari closed 5 months ago

rayanzaatari commented 5 months ago

Note: Issue similar to https://github.com/NativeScript/firebase/issues/221

Packages used

"@nativescript/firebase-core": "^3.2.4", "@nativescript/firebase-messaging": "^3.2.3",

Firebase initialization

Screenshot 2024-04-09 at 11 26 10 PM

Request Permission

Screenshot 2024-04-09 at 11 26 31 PM

Console

Screenshot 2024-04-09 at 11 05 43 PM

When I attempt to get the token any way, console then shows:

Screenshot 2024-04-09 at 10 25 21 PM

I have renamed my app-name.entitlements to app.entitlements.

I have added to my info.plist <key>FirebaseAppDelegateProxyEnabled</key> <false />

What's super weird is that the plugin generates an _onToken message containing the FCM token, that I'm able to use from firebase messaging console to push notifications normally! I'm just unable to get the token in order to send & store in my DB!

rayanzaatari commented 5 months ago

After many hours, I realized that the documentation mentions this

Screenshot 2024-04-10 at 12 27 07 PM

So it will not work on an emulator, while it works on a real device