Closed xhijack closed 9 years ago
I've been having the same problem. It looks like this is because:
def send_notification_multiple(self, frame): return self.write(frame.get_frame())
does not do what send_notification does:
self._sent_notifications.append(dict({'id': identifier, 'message': message}))
So _sent_notifications is empty when the worker thread tries to get the remaining notifications.
I created a pull request which seems to fix this problem : https://github.com/djacobs/PyAPNs/pull/92
Have you tested it? I've tested it and it didn't show any error. but my notif isn't sent
To see errors you need to register a response_listener before you send. For example:
def response_listener(error_response): print error_response apns_connection_sandbox.gateway_server.register_response_listener(response_listener)
I believe the intended behavior of the enhanced frames is to basically follow this pattern:
So basically the intention appears to be that it tells you which notifications are bad and why (status code), and helps you to retry the notifications which were dropped due to the bad one.
I'm guessing that your apns token is bad or your key/cert is bad.
Hi, I tried to use enhanced with frame (multiple token).
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in bootstrap_inner self.run() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run self.__target(_self.args, *_self.__kwargs) File "/Users/appsfoundry/sites/flask/scooprms/ENV/lib/python2.7/site-packages/apns.py", line 564, in _read_error_response self._resend_notifications_by_id(identifier) File "/Users/appsfoundry/sites/flask/scooprms/ENV/lib/python2.7/site-packages/apns.py", line 567, in _resend_notifications_by_id fail_idx = Util.getListIndexFromID(self._sent_notifications, failed_identifier) File "/Users/appsfoundry/sites/flask/scooprms/ENV/lib/python2.7/site-packages/apns.py", line 589, in getListIndexFromID return next(index for (index, d) in enumerate(the_list) StopIteration