Code Monkey home page Code Monkey logo

django-amazon-sns-mobile-push-notification's People

Contributors

ernestofgonzalez avatar pythonicrubyist avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

django-amazon-sns-mobile-push-notification's Issues

Add `badge` argument to `client.Client.publish_to_ios` method

From Local and Remote Notification Programming Guide: Creating the Remote Notification Payload, we see that the "aps" entry includes a "badge" entry itself, which accepts an integer to set the app's devices badge number.

We'll had an optional badge argument to client.Client.publish_to_ios in order to be able to pass a payload like

{
    "aps" : {
        "alert" : {
            "title" : string,
            "body" : string,
            "sound": string
        },
        "badge" : number
    },
    "id" : string,
    "type": string,
    "serializer": object
}

In order to pass badge down to publish_to_ios we nee to add the badge param to the following methods:

  • tasks.send_sns_mobile_push_notification_to_device
  • models.Device.send
  • and finally client.Client.publish_to_ios.

`SyntaxError: Generator expression must be parenthesized` running tests

I'm running tests on python 3.9 and got the trace

(env) ernestogonzalez@Ernestos-MBP django-amazon-sns-mobile-push-notification % 
python3 manage.py test
Traceback (most recent call last):
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/opt/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/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 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/__init__.py", line 4, in <module>
    from django.contrib.admin.filters import (
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/filters.py", line 10, in <module>
    from django.contrib.admin.options import IncorrectLookupParameters
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/options.py", line 12, in <module>
    from django.contrib.admin import helpers, widgets
  File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/widgets.py", line 152
    '%s=%s' % (k, v) for k, v in params.items(),
    ^
SyntaxError: Generator expression must be parenthesized

This is a known incompatibility related to Python issue #32012. For more info check this StackOverflow question.

The quick fix is to upgrade Django to 1.11.17.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.