jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.28k stars 618 forks source link

FCM send_all deprecated in favor of send_each/send_each_for_multicast, will stop working in June #712

Closed guspix closed 7 months ago

guspix commented 7 months ago

Looking through the firebase_admin docs for the messaging.send_all method, I saw this: send_all() is deprecated. Use send_each() instead.

I investigated a bit further and in the firebase FAQ found this:

Screenshot 2024-04-08 at 12 21 59

From what I can see in the master branch of the code, all paths from the GCMDevice send_message function lead to the send_all function from firebase_admin, which would mean that all FCM notifications sent using this library would stop working in June. I know that there has been a big effort for migrating this library to the new FCM V1 API and there is a pending release that's supposed to go out soon but, unless I'm missing something, I think it's worth delaying the release for a few days while this is fixed since it would break FCM functionality if it isn't released before June 21.

From the docs I gather that send_each should basically be a drop in replacement for send_all, so the changes wouldn't be big. I can try to make a pull request for these changes, though I'm not sure how to set up and run the tests for the project.

Let me know if I missed something.

tuky commented 7 months ago

Seems like a very easy fix looking at https://github.com/xtrinch/fcm-django/commit/8e95b7c87ac365ae06dc9db6e67753abeed09527. Great catch, do you want to PR?