I have seen this topic discussed before, but I think it\'s not the same scenario.
I\'m trying to send push notification from one device (going to be an admin device)
I also got the same error, but mine was on the server side(push from rails to android), but my problem was that i had forgot to specify the content type in the header(i am using RestClient to post to firebase). Hope it might help someone
RestClient.post( "https://fcm.googleapis.com/fcm/send",
{:to => reg_id,:notification => options }.to_json,{:content_type => :json, :accept => :json,:Authorization => "key=*****"}
I was using/trying to send FCM Push notification using Postman web API Client app, to FCM URL: https://fcm.googleapis.com/fcm/send
And I had used a wrong Content-Type: application/x-www-form-urlencoded
, So I changed it to
Content-Type: application/json
This is basically required, as we are sending the Push Notification as a JSON Payload.
Cheers!
Thank you for posting your answer, anyway my codes works now, all I had to do is change the content-type (I have just copied from firebase docs the content-types )and send it to a subscribe topic.... now all my users can get the notification from my device :-).