A simple Apple push notification service provider
Project description
apush
=====
A Simple Apple Push Notification Service Provider.
```python
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)
service.send(notification)
# For several notifications
for n in notifications:
service.queue(n)
service.flush()
# Check errors
for (status, identifier, token) in service.errors:
if status == ERROR_INVALID_TOKEN:
remove(token)
# Check feedback service for invalid tokens
for (timestamp, token) in service.feedbacks:
remove(token)
```
=====
A Simple Apple Push Notification Service Provider.
```python
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)
service.send(notification)
# For several notifications
for n in notifications:
service.queue(n)
service.flush()
# Check errors
for (status, identifier, token) in service.errors:
if status == ERROR_INVALID_TOKEN:
remove(token)
# Check feedback service for invalid tokens
for (timestamp, token) in service.feedbacks:
remove(token)
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apush-0.0.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
apush-0.0.1.macosx-10.7-intel.exe
(66.8 kB
view hashes)
Close
Hashes for apush-0.0.1.macosx-10.7-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | cefdddb3b6338e954e99a294f5ab1069eacccc3b9896187c66f62e0ea9d44417 |
|
MD5 | 1352ebaa0cbcd6c6efb2852f480a3e15 |
|
BLAKE2b-256 | 227c60f4005c3fea54599375d5d6c68c48778245ddc4a24e8e43196361936da6 |