Skip to content

suofiya/python-push

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  1. Blackberry Push Protocol.
In development:
_______________
3. iOS APN
4. Windows Phone 7
5. Symbian
6. Browsers (With sockets)
  1. 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 %sn' % (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.

About

Python server-side library for sending Push Notifications to multiple mobile platforms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published