firebasefirebase-cloud-messagingnativescript

FCM - Push notification works only in console not in postman


My application developed in NativeScript. For FCM I use nativescript-plugin-firebase.

I have received a push notification whenever I tried from the FCM console. But, I never received a push notification when I try from post man as below.

URL : POST : https://fcm.googleapis.com/fcm/send
Headers : Authorization = key="******", Content-Type=application/json

Data :

{
    "data": {
        "title": "RAJA RAJA",
        "message": "another test",
        "name": "Muthukumar ME"
    },
    "to" : "**************************************"
}

Response :

{
    "multicast_id": 5806593945960213086,
    "success": 1,
    "failure": 0,
    "canonical_ids": 0,
    "results": [
        {
            "message_id": "0:1521623661699559%161a06bff9fd7ecd"
        }
    ]
}

Anyone knows what have I missed that push notification is not coming when I try in postman even though I get a success response.


Solution

  • { 
        "to" : "********",
        "priority": "high",
        "notification": {
            "title": "Title",
            "body" : "First Notification",
            "text": "Text"
        }
    }