Cordoba, Firebase, FCM plugin - Don't show notifications in the notification bar on iOS

I use this plugin with the corridor: cordova-plugin-fcm to receive notifications.

It works great on Android.

A problem with iOS, when the application is in the foreground, notifications arrive. But when the application is closed or in the background, the notification does not appear in the notification panel, but when I open the application, I see a message about arrival and the pop-up window that I generate opens.

But I really need the notification to appear on the lock screen and in the notification bar.

This is what I submit to the Firebase API:

/ POST to https://fcm.googleapis.com/fcm/send

And in the body I send this:

{
  "to" : <USER_TOKEN>,
  "alert":"Test",
  "notification": {
    "alert":"Test test",
    "title": "Notification test",
    "text": "Testing notification text"
  },
  "priority": 10,
  "content_available": true
}

I also tried with "priority": "high"and got the same results.

, . .

"aps" , .. .

, - .

PS: iOS v10.1.1

PS2: Android.

, , , :

API Firebase push- API

iOS Push-, API

.

+4
2

APN console.firebase.google.com,

APN Firebase. APN, . SSL APNs Provisioning.

Firebase , " ", " ". " " , . . .p12 , . , . "".

https://firebase.google.com/docs/cloud-messaging/ios/client

+1

, , "" ""; "" "", pushnotifications . "title" "body" Json, iOS notificatios, -.

, . :

    "data":{
     "data1":"value1",
     "data2":"value2"
  }

, - :

{
  "to" : <USER_TOKEN>, //or /topics/<topicname> or /topics/all"
   "notification": {
    "title": "Notification test",
    "body": "Testing notification text"
  },
      "priority": high,
      "sound":"default", //not using this one wont make your iOS device use sound
      "click_action":"FCM_PLUGIN_ACTIVITY",
      "icon":"fcm_push_icon"
}

:

     {
          "to" : <USER_TOKEN>, //or /topics/<topicname> or /topics/all"
          "notification": {
            "title": "Notification test",
            "body": "Testing notification text"
          },
          "data":{
             "data1":"value1",
             "data2":"value2"
          },
          "priority": high,
          "sound":"default", //not using this one wont make your iOS device use sound
          "click_action":"FCM_PLUGIN_ACTIVITY",
          "icon":"fcm_push_icon"
      }

, ,

0

Source: https://habr.com/ru/post/1664689/


All Articles