Answer the question
In order to leave comments, you need to log in
How to send push notifications using Google?
Good day to all.
I'm trying to send push notifications to browsers on my site.
The permission is already displayed in the browser, I already receive the browser ID, but how to send a notification?
I send a PHP CURL request here - https://fcm.googleapis.com/fcm/send but I get a 401 error (such as failed authorization).
The body of the request as follows:
{ "registration_ids": , "data": { "message": "Yii"}} is
also transmitted in the Header content / type = json and authorization where an API key .
What am I doing wrong? Maybe the API key is wrong?
I get the error "Invalid (legacy) Server-key delivered or Sender is not authorized to perform request.
Error 401".
I think the error is in the API key, where can I get it?
I read a couple of manuals, but as I understand it, something has changed in Google and Google Cloud Messages is now Firebase Cloud Messages and, accordingly, something else needs to be done.
Can you please help?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question