PyAPNs icon indicating copy to clipboard operation
PyAPNs copied to clipboard

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

Open ablegao opened this issue 9 years ago • 4 comments

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)

ablegao avatar Mar 28 '16 12:03 ablegao

+1

Arti3DPlayer avatar May 25 '16 18:05 Arti3DPlayer

+1

sennoy avatar May 26 '16 08:05 sennoy

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

farridav avatar Jun 07 '16 10:06 farridav

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)

TerryZjl avatar Nov 22 '18 03:11 TerryZjl