GithubHelp home page GithubHelp logo

amyth / django-instapush Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 4.0 99 KB

Django push notifications app that handles both GCM and APNS notifications. This app also supports mongoDB models (mongoengine).

Home Page: http://www.techstricks.com

License: MIT License

Python 100.00%

django-instapush's People

Contributors

amyth avatar andreffs18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-instapush's Issues

Change in apns certificate section headers

Hi,

I do not know if this library is still maintained as I see the last commit was three years ago.
Anyway, today I have noticed that in new apns certificates the header
-----BEGIN RSA PRIVATE KEY-----

has been substituted by
-----BEGIN PRIVATE KEY-----

and same for
-----END RSA PRIVATE KEY-----
with
-----END PRIVATE KEY-----

So I suggest to change the method _check_certificate in instapush/libs/apns to include
this changes

def _check_certificate(ss):
    mode = 'start'
    for s in ss.split('\n'):
        if mode == 'start':
            if 'BEGIN RSA PRIVATE KEY' in s or 'BEGIN PRIVATE KEY' in s:
                mode = 'key'
        elif mode == 'key':
            if 'END RSA PRIVATE KEY' in s or 'END PRIVATE KEY' in s:
                mode = 'end'
                break
            elif s.startswith('Proc-Type') and 'ENCRYPTED' in s:
                raise Exception("The certificate private key should not be encrypted")
    if mode != 'end':
        raise Exception("The certificate doesn't contain a private key")

Hope this can help.

Best regards,
Luca

Issue in APNs bulk message

Hi,
I found an issue when sending bulk messages.

In lib/apns.py inside the apns_send_bulk_message function you are cycling over all devices and calling the function _apns_send.

The problem is that _apns_send on line n 123 uses the pop() method to retrieve the notification message:

alert = custom_params.pop('message', '')

and since the message is always stored in the same dictionary, already the second device will receive an empty message.

If you take a look at django-push-notification they simply solved it avoiding the pop method.

Best regards,
Luca

Multiple APNS certificates for different apps

Hi there,

First of all, thank you for your effort to bring Notifications to mongoengine Django projects.
My backend has to support two distinct apps (i.e. client's app and employee's app) and push notifications to both.

Is there a way to register multiple .pem files in order to serve different apps?

Cheers.

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.