I'm using this plugin with cordova: cordova-plugin-fcm to get notifications working.
It works good on Android.
Problem is with iOS, when the app is in foreground the notifications arrives. But when the app is closed or in background, the notification doesn't show in notification bar, but when I open the application I can see the notification arriving and the popup I generate, gets opened.
But I really need to notification to show in lock screen and in the notification bar.
This is what I'm sending to Firebase API:
/ POST to https://fcm.googleapis.com/fcm/send
And in the body I'm sending this:
{
"to" : <USER_TOKEN>,
"alert":"Test",
"notification": {
"alert":"Test test",
"title": "Notification test",
"text": "Testing notification text"
},
"priority": 10,
"content_available": true
}
I've also tried with "priority": "high"
and get the same results.
The notification arrives, but it only shows when I open the app. I don't even get it in the notification bar or lock screen.
Also I tried adding the "aps"
property in the body, with all the information inside.. doesn't work.
I hope someone can throw some light into this..
PS: iOS v10.1.1
PS2: Works good on all android devices.
I've already read some answers from the community but doesn't seem to work:
Firebase API is not sending push notifications when using the API
iOS not receiving Firebase Push Notification sent through the API
Thanks for your time.