Skip to content
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

Closed
jhonsoto-aflore opened this issue Jun 17, 2024 · 6 comments
Closed

Migrate from legacy FCM APIs to HTTP v1 #325

jhonsoto-aflore opened this issue Jun 17, 2024 · 6 comments

Comments

@jhonsoto-aflore
Copy link

FCM_END_POINT = "https://fcm.googleapis.com/fcm/send"

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

@jinwoojimmy
Copy link

@jhonsoto-aflore
#321
It seems like updated version will be released soon.

@olucurious
Copy link
Owner

@panki
Copy link

panki commented Jun 20, 2024

@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.

@olucurious
Copy link
Owner

Please send a PR then

@panki
Copy link

panki commented Jun 20, 2024

@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).

@panki
Copy link

panki commented Jun 20, 2024

Another possible improvement is obtaining the project ID from the service account key JSON file (project_id attribute) instead of requiring it to be passed as a constructor argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants