Hadjer Kh
Hadjer Kh

Reputation: 53

Ionic FCM push notification not received when app is opened and screen locked unless it's tapped

I'm developing an ionic application and I'm using FCM push notification to send notifications to the user.

This is the JSON payload of the sent notification :

    {
    "to" : "access_token",
    "priority": "normal",
    "notification" : {
      "body" : "this is message",
      "title" : "notification Title"
    },
    "data": {
          "link": ....
     }
}

The push notification is received in these different cases :

Is there any way to get the data of a push notification that is in the system tray without clicking on it ?

Upvotes: 1

Views: 2196

Answers (2)

Alghi Fari
Alghi Fari

Reputation: 450

Hope this work! For Foreground you can use Local Notification to show up push notification :

https://ionicframework.com/docs/native/local-notifications/

Upvotes: 1

Than Tun Aung
Than Tun Aung

Reputation: 21

send the notification information along with data object and then , in your ionic project manually set a notification with that data .

Upvotes: 0

Related Questions