Code Monkey home page Code Monkey logo

python-push's Introduction

Python Push Notification Manager

Python Push is a Python server-side library for sending Push Notifications to multiple mobile platforms.
This library is still in its very early stages, for now it is only supported Ping Pushes, which means that no data is sent in the push, but the Demo Application shows a way to handle this using post syncronization wich is even better than send the info in the push.
Again this library is not yet ready for production projects.

Supported Platforms

  1. Android GCM
  2. Blackberry Push Protocol.

In development:

  1. iOS APN
  2. Windows Phone 7
  3. Symbian
  4. Browsers (With sockets)
  5. Windows 8

Usage

For a full project with mobile apps see the Demo Application.

You'll have to run "python setup.py install" or install Python AsyncHTTP and its dependences.

Raw Python:

Sending a ping Push:

from python_push.push_manager import PushManager
from python_push.gcm.gcm_push_service import GCMPushService
from python_push.blackberry.bb_push_service import BBPushService
from python_push.message import Message
from python_push.device import Device

push_manager = PushManager([
    GCMPushService({'api_id': 'GCM API KEY'}),
    BBPushService({'api_id': 'BLACKBERRY APP ID', 'password': 'BLACKBERRY APP PASSWORD'})
])

msg = Message()
device_list = [
    Device(BBPushService.type, 'BLACKBERRY DEVICE PIN'),
    Device(GCMPushService.type, 'GCM DEVICE TOKEN')
]

status_dict = push_manager.send(msg, device_list)

for type, status in status_dict.iteritems():
        print 'Service %s: Status %i, Content %s\n' % (type, status.code, status.raw)

Updates

4/4/2013:

Changed from GRequests to Python AsyncHTTP
GRequests is to hard to install on Mac, Windows and some Linux distros and has too many dependences, for that reason python-push now is using "python-asynchttp" to send asynchronous HTTP and HTTPS requests.

12/11/2012:

The demo proyect is ready and has its own repo: https://github.com/maxrevilo/python-push-demo
It features a Django Server using Python Push and four navite apps, two of Android and Two of Blackberry.

10/2/2012:

Now we support "ping" pushes to Android GCMs and Blackberries devices.
A "ping" push is a push which carries no content, for GCM this means use collapse_key.
These features are under development and not widely tested.
Theoretically is possible to send push with content.

python-push's People

Contributors

maxrevilo avatar

Watchers

 avatar

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.