Closed sevdog closed 7 months ago
You can change the API Endpoint for FCM by setting an attribute in push notification config as follows,
PUSH_NOTIFICATIONS_SETTINGS = {
"FCM_API_KEY": "********",
"FCM_POST_URL": "https://fcm.googleapis.com/v1/projects/{project_id}/messages:send",
.......
.......
}
Where you able to solve this??
ATM I do not have time to work on a PR about this issue.
Since Google is still maintaining legacy API (to keep alive many legacy app) this is not an high-priority.
When I have some free time I could try to address this.
This could be accomplished by using official firebase-admin
or by using the example code provided by firebase guide.
What concern me is that since APIs are different they accept different parameter format.
Looking into Firebase docs seems that API v1 has a different param signature from legacy one.
There is an official guide which explains why just changing URL is not enough.
First of all, sorry to be not responsive here as it's my secondary github account. Seems like I went for a winter sleep :P
Thanks, @sevdog for pointing the issue with my short reply. Yes, just changing URL is not enough here and actually its not the true solution in any system anywhere when you are upgrading specifically any kind of API version. So AT THAT TIME, how I solved was by overriding few core methods for myself following the same official docuement that you had also mentioned in your reply. So I actually had to customize the library on a short notice to meet my deadline. But unfortunately, that was not something to be shared with public or send a PR as well :D
@sevdog , thanks again for your latest suggestion, I will go through this new library as I predict that I will again have to work on push notifications soon and quite on a large scale TBH. :D
The legacy API are deprecated from yesterday and will be removed on June 20th 2024
Looking aroud there is this package which implements only FCM: https://github.com/xtrinch/fcm-django/
It can be taken as an example.
As of now FCM notifications are sent to
https://fcm.googleapis.com/fcm/send
which is a legacy API.Messages should be sent to current API endpoint: