An open API service indexing awesome lists of open source software.

https://github.com/chatsecure/apns-client

Python client for Apple Push Notification service (APNs).
https://github.com/chatsecure/apns-client

Last synced: 11 months ago
JSON representation

Python client for Apple Push Notification service (APNs).

Awesome Lists containing this project

README

          

apns-client.
====================================
Python client for `Apple Push Notification service (APNs) `_.
Check `documentation `_ to learn how to use it.

Check the client with similar interface for `Google Cloud Messaging `_.

Requirements
------------

- `pyOpenSSL `_ - OpenSSL wrapper.
- `omnijson `_ if you use Python 2.5 or older.

Standard library has support for `SSL transport
`_. However, it is impossible to use
it with certificates provided as a string. We store certificates in database,
because we handle different apps on many Celery worker machines. A dirty
solution would be to create temporary files, but it is insecure and slow. So,
we have decided to use a better OpenSSL wrapper and ``pyOpenSSL`` was the
easiest to handle.

Alternatives
------------

There are `many alternatives
`_
available. We have started with `pyapns `_
and `APNSWrapper `_. This library
differs in the following design decisions:

- *Support certificates from strings*. We do not distribute certificate files
on worker machines, they fetch it from the database when needed. This
approach simplifies deployment, upgrades and maintenance.
- *Keep connections persistent*. An SSL handshaking round is slow. Once
connection is established, it should remain open for at least few minutes,
waiting for the next batch.
- *Support enhanced format*. Apple developers have designed a notoriously bad
push protocol. They have upgraded it to enhanced version, which makes it
possible to detect which messages in the batch have failed.
- *Clean pythonic API*. No need for lots of classes, long lists of exceptions etc.
- *Do not hard-code validation, let APNs fail*. This decision makes library
a little bit more future proof.

Support
-------
APNs client was created by `Sardar Yumatov `_,
contact me if you find any bugs or need help. Contact `Getlogic
`_ if you need a full-featured push notification service
for all popular platforms. You can view outstanding issues on the `APNs
Bitbucket page `_.