Current behavior:
After you accept the permission prompt on iOS and send push notifications while the app is in the foreground, the app receives the data but doesn't display a native notification. If you then force quit the app and relaunch it and while the app is in the foreground send push notifications again they do come display as native notifications.
This has been tested on test app (https://github.com/dpa99c/cordova-plugin-firebasex-test) which produces the same results.
Expected behavior:
After you accept the permission prompt on iOS and send push notifications while the app is in the foreground, you should see a native notification.
Steps to reproduce:
The payload used was as follows (device tokens have been removed):
{
"registration_ids": [ ],
"notification": {
"title": "Hello there",
"body": "Have a great day",
"sound": "default"
},
"data": {
"notification_foreground": "true"
}
}
Environment information
_Runtime issue_
_iOS build issue:_
Same problem
I can repro this - will investigate and fix
I have now tested with version 6.1.0 and can confirm that the bug has now been fixed, thanks @dpa99c.
@dpa99c I am receiving the same issue, while the app is in the background the native notification comes but while the app is in foreground its not displaying it.
Here is the code I am getting as message from onMessageReceived method:
[Log] message (raven.min.js, line 2)
Object
android: "{\"notification\":{\"icon\":\"https:\\/\\/www.arcedior.com\\/assets\\/images\\/favicon\\/apple-icon-72x72.png\"}}"
aps: {alert: {title: "title", body: "body of message."}, sound: "mySound"}
data: "{\"image\":null,\"resurl\":\"\",\"notification_android_icon\":\"https:\\/\\/www.arcedior.com\\/assets\\/images\\/favicon\\/apple-icon-72x72.png\",\"sound\":\"m…"
gcm.message_id: "1568358726993491"
gcm.notification.notification_android_icon: "https://www.arcedior.com/assets/images/favicon/apple-icon-72x72.png"
gcm.notification.notification_foreground: "true"
gcm.notification.resurl: ""
google.c.a.e: "1"
messageType: "notification"
name: "my_notification"
notification: "{\"image\":null,\"resurl\":\"\",\"notification_android_icon\":\"https:\\/\\/www.arcedior.com\\/assets\\/images\\/favicon\\/apple-icon-72x72.png\",\"sound\":\"m…"
Object Prototype
Platform: IOS
Cordova v: 9.0.0 ([email protected])
Xcode v: Version 10.3 (10G8)
Any help is most appreciated and thank you so much for this great plugin!!