I suggest downloading a new working PHP script for sending push notifications Firebase Cloud Messaging (FCM) Push Notifications HTTP v1 API, which you can adapt and use in your projects.
The script implements the function of obtaining a token for HTTP v1 authorization (access token) with the function of sending a message to a device token.
The script was written and tested in September 2024.
The script is suitable as an example for developers who are looking for a solution for sending push notifications via firebase, in particular how to get an access token with the new version of FCM V1.
In 2024, the old version of the protocol for sending push notifications to Firebase stopped working and was replaced by a new version of the HTTP v1 API for which this script was written.
https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=ru
API Firebase HTTP v1 Code example in PHP.
Firebase API HTTP v1 access token PHP example.
After payment, you will receive a small script consisting of one PHP file, the code of which contains comments with instructions.
No feedback yet