Closed jhonsoto-aflore closed 2 months ago
@jhonsoto-aflore https://github.com/olucurious/PyFCM/pull/321 It seems like updated version will be released soon.
@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 https://github.com/olucurious/PyFCM/pull/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 (project_id
attribute) instead of requiring it to be passed as a constructor argument.
https://github.com/olucurious/PyFCM/blob/ee73aa44ee1f44833b6dd22e7457f1452862173d/pyfcm/baseapi.py#L27
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