Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install apns-client

How to install apns-client

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install apns-client
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1.6 Available View build log
 
License
Apache 2.0
Dependencies
Imports
Lastest release
version 0.1.6 on Jan 9th, 2014

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

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.

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.