Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

A simple Apple push notification service provider

Project description


### A simple Apple push notification service provider in Python.

Important: `Service` overrides `identifier` attribute of `Notification` object.
Instead, errors include token.

from apush import Service, Notification, ERROR_INVALID_TOKEN

token = 'hex-encoded token'.decode('hex')
service = Service('/path/to/certificate.pem')
notification = Notification(token, alert='A new notification', badge=1)

For several notifications, use `queue` and `flush`.
for n in notifications:


Check for errors after sending notifications.
def remove(token):
'''Remove token from database.'''

for (status, identifier, token) in service.errors:

Check feedback service for invalid tokens.
for (timestamp, token) in service.feedbacks:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
apush-0.2.3.tar.gz (4.4 kB) Copy SHA256 hash SHA256 Source None Nov 16, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page