1

I’m sure this is obvious, but I’m missing it. I’ve installed PyAPNs via pip:

# pip install apns

Then when I try to use the “enhanced” flag in APNs, it’s not there.

# python
Python 2.7.6 (default, Nov 11 2013, 18:34:29) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from apns import APNs
>>> server = APNs(use_sandbox=True, cert_file=“/mydir/apns-dev-cert.pem", key_file=“/mydir/apns-dev-key.pem", enhanced=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'enhanced'
>>> 

And sure enough the 1.1.2 version that pip installed doesn’t have that keyword. But I thought this was the latest released version in the PyAPNs repository https://github.com/djacobs/PyAPNs.

I want to use the ‘enhanced’ keyword, for error checking. Any ideas?

Dylan
  • 2,315
  • 2
  • 20
  • 33

2 Answers2

2

Version 1.1.2 that is currently available on PyPI doesn't provide an enhanced argument for APNs class (see source).

If you want this functionality, install the module directly from github (master branch):

pip install git+https://github.com/djacobs/PyAPNs.git

Note that they haven't updated the package version in setup.py, so, if you have this module installed already, uninstall it first, then install it from github:

pip uninstall apns
pip install git+https://github.com/djacobs/PyAPNs.git
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
0

if you want more error-free version, you may try this fork

pip install git+https://github.com/jimhorng/PyAPNs.git

which resolved errors from long idle connections: https://github.com/djacobs/PyAPNs/issues/94

Jim Horng
  • 1,587
  • 1
  • 13
  • 23