nativescript-plugin-firebase icon indicating copy to clipboard operation
nativescript-plugin-firebase copied to clipboard

Not receiving FCM push notifications on iOS, but can receive from APNS

Open JuanDeLeon opened this issue 6 years ago • 5 comments

Hi, I'm running on iOS device (NS/iOS 5.2). The onPushTokenReceivedCallback is returning 2 different tokens on init, one for APNS and another one for FCM.

If I use the Pusher tool on Mac, and use the APNS token, I do get the notification on device.

However if I use the FCM token, the curl returns a success which means the device token is actually registered, but I do not get any notifications at all.

Any ideas of what could be wrong? This is the CURL (taken from example files) and my config file:

curl -X POST --header "Authorization: key=AAAA...:xxxxxx...." --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"data\":{\"foo\":\"bar\"}, \"priority\": \"High\", \"content_available\":true, \"to\": \"euxZqvnMaI0:APA91bFFAhvnO5MnpOo39JJCLYhsiuRImhxMoo5AlDo_6J872MujbE7VfVFFVaQ0OSNPDW_VRsx0mcBf85gAbg3uK1bL0HyGvKEkm1jUppG2juOc_OfDvccedMVRIuTe8vjOGjqGQ2L6\"}"
{"multicast_id":5492834173422874287,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1550509111206737%f5a30ca3f5a30ca3"}]}
{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": false,
    "realtimedb": false,
    "authentication": false,
    "remote_config": false,
    "performance_monitoring": false,
    "messaging": true,
    "crashlytics": true,
    "crash_reporting": true,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "invites": false,
    "dynamic_links": false,
    "ml_kit": false
}

JuanDeLeon avatar Feb 18 '19 17:02 JuanDeLeon

did you ever solve this? I have the same problem

Mixelated avatar Oct 22 '19 06:10 Mixelated

Not really, but as a workaround I save and use only the APNS token. I do a fixed length comparison, since FCM tokens are longer.

JuanDeLeon avatar Oct 22 '19 13:10 JuanDeLeon

just to update: I solved the issue by removing nativescript-facebook and instead authenticate users through firebase fb. It was conflicting with nativescript-firebase

Mixelated avatar Nov 04 '19 07:11 Mixelated

Experienced same problem, push notification on iOS wasn't working. As soon as I deleted nativescript-facebook plugin, it started to work. Even though I was seeing message coming in, in the callback.

maxorlovsky avatar Jan 13 '20 08:01 maxorlovsky

i faced same issue, but i didn't use "nativescript-facebook" anybody know how to fix it in my case?

chanyb avatar Dec 24 '21 10:12 chanyb