apush
=====
### A simple Apple push notification service provider in Python.
Important: `Service` overrides `identifier` attribute of `Notification` object.
Instead, errors include token.
```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, use `queue` and `flush`.
```python
for n in notifications:
service.queue(n)
service.flush()
```
Check for errors after sending notifications.
```python
def remove(token):
'''Remove token from database.'''
...
for (status, identifier, token) in service.errors:
if status == ERROR_INVALID_TOKEN:
remove(token)
```
Check feedback service for invalid tokens.
```python
for (timestamp, token) in service.feedbacks:
remove(token)
```
=====
### A simple Apple push notification service provider in Python.
Important: `Service` overrides `identifier` attribute of `Notification` object.
Instead, errors include token.
```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, use `queue` and `flush`.
```python
for n in notifications:
service.queue(n)
service.flush()
```
Check for errors after sending notifications.
```python
def remove(token):
'''Remove token from database.'''
...
for (status, identifier, token) in service.errors:
if status == ERROR_INVALID_TOKEN:
remove(token)
```
Check feedback service for invalid tokens.
```python
for (timestamp, token) in service.feedbacks:
remove(token)
```
Metadata
Release files for apush 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apush-0.2.3.tar.gz | 4.4 kB | Details |
Release files / apush-0.2.3.tar.gz
| Download URL | apush-0.2.3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a758e183ed3678ac94a580243126092c6f69bd71e528b6c85bd1b58cfd96b44f
|
|
BLAKE2b-256 checksum How to use checksums |
ba4d544a6b9c4bd4cda2b61648d2156c4baa3fdfe8535a2174757527d970354e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |