PyAPNs
PyAPNs copied to clipboard
AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications'
python 2.7.3
apns.gateway_server.send_notification_multiple(frame)
File "/home/gaoenbo/py27/local/lib/python2.7/site-packages/apns.py", line 559, in send_notification_multiple
self._sent_notifications += frame.get_notifications(self)
AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications'
# Send multiple notifications in a single transmission
frame = Frame()
identifier = 1
expiry = time.time()+3600
priority = 10
frame.add_item('b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87', payload, identifier, expiry, priority)
apns.gateway_server.send_notification_multiple(frame)
+1
+1
This is due to the latest release not being available on pypi, perhaps install from github (until https://github.com/djacobs/PyAPNs/issues/163 is resolved) the issue has been resolved here https://github.com/djacobs/PyAPNs/commit/1842c40d8b9586643097c9ad142c5e447408d14f
If you want to use enhance mode, please refer to document and specify enhanced=True, apns_enhanced = APNs(use_sandbox=True, cert_file='apns.pem', enhanced=True)