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

ValueError: messages must not contain more than 500 elements #730

Closed Pablo849 closed 4 months ago

Pablo849 commented 5 months ago

I have 556 FCM devices in my system. When I try to send a bulk message to all devices, I get "ValueError: messages must not contain more than 500 elements". I found a settings parameter in push_notifications/conf/app.py -> MAX_RECIPIENTS. But is not clear in docs how to define this parameter. How can I set it correctly? I use firebase_admin.initialize_app(credentials=cred) with firebase credentials JSON file.

jamaalscarlett commented 4 months ago

You need to set the FCM_ MAX_RECIPIENTS setting value. See: https://github.com/jazzband/django-push-notifications/blob/68bae4f1fe709bf08aa97ae683c0b4d226e2da88/push_notifications/settings.py#L12