-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from legacy FCM APIs to HTTP v1 #325
Comments
@jhonsoto-aflore |
@olucurious It doesn't work, migration is not completed. I have a fork where I fixed all the issues. I can do a PR if the author is not gonna complete the migration. |
Please send a PR then |
@olucurious Sorry for the confusion. I was referring to the version #319. I just realized you already made the fix in 2.x version. I made almost identical changes a few days ago to make it work. The primary difference is I kept the backward compatibility. I have one minor comment regarding your version. The FCM token has a 24-hour lifetime, so there is no need to refresh it that often (every 30 minutes). |
Another possible improvement is obtaining the project ID from the service account key JSON file ( |
PyFCM/pyfcm/baseapi.py
Line 27 in ee73aa4
Apps using the deprecated FCM legacy APIs for HTTP and XMPP should migrate to the HTTP v1 API at the earliest opportunity. Sending messages (including upstream messages) with those APIs was deprecated on June 20, 2023, and will be removed on June 21, 2024.
HTTP requests before:
POST https://fcm.googleapis.com/fcm/send
After:
POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send
The text was updated successfully, but these errors were encountered: