jazzband / django-push-notifications

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

django.core.exceptions.ImproperlyConfigured: Application (FCM) does not support the setting 'MAX_RECIPIENTS'. #588

Closed pydlv closed 2 years ago

pydlv commented 3 years ago

I am getting this this error when ever I try to use devices.send_message(). I have not defined MAX_RECIPIENTS anywhere in the config. Doing so doesn't resolve the error.

Here is my config:

# Push Notifications
PUSH_NOTIFICATIONS_SETTINGS = {
    # Load and process all PUSH_NOTIFICATIONS_SETTINGS using the AppConfig manager.
    "CONFIG": "push_notifications.conf.AppConfig",

    "UPDATE_ON_DUPLICATE_REG_ID": True,

    # collection of all defined applications
    "APPLICATIONS": {
        "app_push_fcm": {
            # PLATFORM (required) determines what additional settings are required.
            "PLATFORM": "FCM",

            # required FCM setting
            "API_KEY": "apikey"
        }
    }
}

and then I try to send a notification to my user using the following code:

devices = GCMDevice.objects.filter(user=request.user)
devices.send_message("You have succesfully requested an appointment!")

and it gives me this error: django.core.exceptions.ImproperlyConfigured: Application 'app_push_fcm' (FCM) does not support the setting 'MAX_RECIPIENTS'.

Iterating through the devices and sending off a message like below still throws the same error:

for device in devices:
    device.send_message(...)
pydlv commented 3 years ago

I may have figured it out. I need to change the values in the cloud_message_type column from GCM to FCM in the push_notifications_gmddevice table.

Karinmia commented 2 years ago

Faced the same error. @pydlv your comment fixed it so this issue can be closed