jazzband / django-push-notifications

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

"application_id" is not passed properly when targeting all users in FCM #547

Open shamilbuzz opened 4 years ago

shamilbuzz commented 4 years ago

https://github.com/jazzband/django-push-notifications/blob/033839bb1253dc0b9638b1da4bfd1e112678024e/push_notifications/gcm.py#L209

Currently the line is: _cm_send_request(None, data, cloud_type=cloud_type, **kwargs)

But I suppose it should be: (passing mandatory application_id parameter) _cm_send_request(None, data, cloud_type=cloud_type, application_id=application_id, **kwargs)

Let me know if its something that I have missed? or, my assumption is correct?

belkka commented 4 years ago

I confirm, it looks reasonable. UPD: I am not sure now, because registration_ids=None does not mean "all users", but rather "make request without "registration_ids" field. Since there is no registration ids, it may be no need for application_id. This is only an assumption.

AzikDeveloper commented 1 year ago

what is the status of this?

I'm encountering an ImproperlyConfigured error when using gcm.send_message even though I've specified the application_id.

I spent an entire hour to resolve this issue.

Here is my code: send_gcm_message( registration_ids=ios_fcm_devices_tokens, data=notification.make_notification_payload_data(), cloud_type="FCM", application_id="ios" )

ios_fcm_devices_tokens ended up being an empty list and i encountered #414 . Is this an expected behaviour ?