Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase push notification not showing on phone despite successful response

I am sending a push token to a specific device via the FCM API on testing with Postman, but I intend to send them from the server.

{
    "to" : "my_device_token",
    "notification" : {
        "notificationTitle" :"test from server",
        "notificationBody" :"test lorem ipsum"
    }
}

I am receiving the response

{
    "multicast_id": 4996861050764876123,
    "success": 1,
    "failure": 0,
    "canonical_ids": 0,
    "results": 
    [
        {
            "message_id": "0:1519567530487886%f95ee7d4f95ee123"
        }
    ]
}

Which shows no error, however I don't get any notifications on my phone. I tried the same device token using on firebase website "Notifications => New Message => Single Device", and it works.

I see threads about not receiving the notifications when the app is not running, however I don't get any even if the app is running.

Edit: My application is built using Xamarin.Android, if relevant.

like image 793
bsoolius Avatar asked Feb 25 '18 14:02

bsoolius


1 Answers

The notification property keys are title and body:

{
    "to" : "my_device_token",
    "notification" : {
        "title" :"test from server",
        "body" :"test lorem ipsum"
    }
}

See Table 2b in the documentation.

like image 130
Bob Snyder Avatar answered Sep 16 '22 16:09

Bob Snyder