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

Breaking change in 3.0.3 #735

Open daveisfera opened 3 months ago

daveisfera commented 3 months ago

There's a breaking change in the 3.0.3, so could that be reverted and included in a major release?

jamaalscarlett commented 2 months ago

@daveisfera can you point to the breaking change?

daveisfera commented 2 months ago

It's the FCM change that I linked to. The description at the top of the page that I linked to in the original report says this:

- GCM and legacy FCM API support have been removed. (GCM is off since 2019, FCM legacy will be turned off in june 2024)
- Firebase-Admin SDK has been added
jamaalscarlett commented 1 month ago

Those are the release notes. Do you have specific PR or commit that contains the breaking changes?

daveisfera commented 1 month ago

I'm not sure which commit caused the problem, but with 3.0.2 and before, my application loads.

With 3.0.3, I get this error:

  File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "/usr/src/venv/lib/python3.9/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "/usr/src/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 375, in execute
    autoreload.check_errors(django.setup)()
  File "/usr/src/venv/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/src/venv/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/usr/src/venv/lib/python3.9/site-packages/django/apps/config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/src/app/myapp/models.py", line 34, in <module>
    from myapp.tasks import (
  File "/usr/src/app/myapp/tasks.py", line 13, in <module>
    from myapp.notifications import Notification
  File "/usr/src/app/myapp/notifications.py", line 10, in <module>
    from push_notifications.apns import APNSError
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/apns.py", line 15, in <module>
    from .conf import get_manager  
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/__init__.py", line 22, in <module>
    get_manager()
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/__init__.py", line 16, in get_manager
    manager = import_string(SETTINGS["CONFIG"])()
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/app.py", line 82, in __init__
    self._validate_applications(self._settings["APPLICATIONS"])
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/app.py", line 87, in _validate_applications
    self._validate_config(application_id, application_config)
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/app.py", line 117, in _validate_config
    getattr(self, validate_fn)(application_id, application_config)
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/app.py", line 186, in _validate_fcm_config
    self._validate_allowed_settings(application_id, application_config, allowed)
  File "/usr/src/venv/lib/python3.9/site-packages/push_notifications/conf/app.py", line 227, in _validate_allowed_settings
    raise ImproperlyConfigured(    
django.core.exceptions.ImproperlyConfigured: Platform FCM, app pa_fcm does not support the setting: API_KEY.