fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 991 forks source link

iOS receiving notification but not triggering event #635

Open loama opened 4 years ago

loama commented 4 years ago

The application correctly gets notifications both when it is closed (it goes to the notification tray) and when closed (as logged into Xcode)

2020-04-01 19:00:01.613692-0600 Thunder[3219:559081] Message ID 1: 1585789201052721
2020-04-01 19:00:01.614119-0600 Thunder[3219:559081] {
    aps =     {
        alert =         {
            body = "Notification body";
            title = "Notification title 1";
        };
        category = "FCM_PLUGIN_ACTIVITY";
        sound = default;
    };
    "gcm.message_id" = 1585789201052721;
    "google.c.a.e" = 1;
    "google.c.sender.id" = 615174432734;
    param1 = value1;
    param2 = value2;
}
2020-04-01 19:00:01.614303-0600 Thunder[3219:559081] stringByEvaluatingJavaScriptFromString FCMPlugin.onNotificationReceived({"param2":"value2","aps":{"alert":{"title":"Notification title 1","body":"Notification body"},"sound":"default","category":"FCM_PLUGIN_ACTIVITY"},"google.c.sender.id":"615174432734","google.c.a.e":"1","param1":"value1","gcm.message_id":"1585789201052721"});
2020-04-01 19:00:01.614502-0600 Thunder[3219:559081] [Process] kill() returned unexpected error 1
2020-04-01 19:00:02.226470-0600 Thunder[3219:559081] Received push notification
2020-04-01 19:00:02.227689-0600 Thunder[3219:559081] {"param2":"value2","aps":{"alert":{"title":"Notification title 1","body":"Notification body"},"sound":"default","category":"FCM_PLUGIN_ACTIVITY"},"google.c.sender.id":"615174432734","google.c.a.e":"1","param1":"value1","gcm.message_id":"1585789201052721"}

But the onNotification event is never triggered.

I am just doing:

FCMPlugin.onNotification(function (data) { alert('notification') })

Also the app is failing to fetch the APNS token after the first run. <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"

Macfa commented 4 years ago

+1 same

ragcsalo commented 2 years ago

On iOS my app receives the notification in the tray, but when I tap it and the app starts, I can't process the notification data (because I don't receive an onNotification event... :-/