djacobs / PyAPNs

Python library for interacting with the Apple Push Notification service (APNs)
http://pypi.python.org/pypi/apns/
MIT License
1.22k stars 377 forks source link

AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications' #162

Open ablegao opened 8 years ago

ablegao commented 8 years ago

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)
Arti3DPlayer commented 8 years ago

+1

sennoy commented 8 years ago

+1

farridav commented 8 years ago

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

TerryZjl commented 5 years ago

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)