-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications' #108
Comments
@CTassisF May I know what's the reproducing step of this issue? |
This is how I am sending Push Notifications: import pyapns # I renamed apns.py to pyapns.py
connection = pyapns.APNs(use_sandbox = True, cert_file = StringIO.StringIO(sandbox_cert), key_file = StringIO.StringIO(key))
alert = (self.request.get('alert') if self.request.get('alert') else None)
sound = (self.request.get('sound') if self.request.get('sound') else None)
badge = (long(self.request.get('badge')) if self.request.get('badge') else None)
custom = {'foobar': (long(self.request.get('foobar')) if self.request.get('foobar') else None)}
content_available = (True if sound else False)
payload = pyapns.Payload(alert = alert, sound = sound, badge = badge, custom = custom, content_available = content_available)
frame = pyapns.Frame()
identifier = (long(self.request.get('line')) if self.request.get('line') else 0)
expiry = time.time() + 3600
priority = 10
apnslist = json.loads(self.request.get('json')) # apnslist is an array of APNs tokens
for apns in apnslist:
frame.add_item(apns, payload, identifier, expiry, priority)
connection.gateway_server.send_notification_multiple(frame) |
Hm. Strange. I'll take a look at it later tonight. @CTassisF Sent from my iPhone
|
Please update README if enhaced=True is needed for send_notification_multiple. It wasn't required prior 2.0.1. |
It shouldn't be required, should be a bug
|
Ran into this one too. |
Ran into this one too, running the sample usage script. Adding enchanced=True to the APNs() fixed it, like so: Is this expected behaviour? |
Hm. Is it still doing that? I thought someone else's PR had fixed that bug On Tue, Jun 28, 2016 at 2:03 AM, Boris Stoyanov notifications@github.com
|
Still doing that. Adding |
Adding |
PyAPNs v2.0.1:
AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications'
The text was updated successfully, but these errors were encountered: