pyapns

APNS2 Exception: TooManyProviderTokenUpdates

跟風遠走 提交于 2020-04-30 09:10:46
问题 def process_notification(message): apns = apnsClient apns_response = None try: stream_id = apns.send_notification_async(device_token, apns_payload, target_app) apns_response = apns.get_notification_result(stream_id) except e: logging.error(f"APNS server error occurred.Reason: {apns_response}") if __name__ == '__main__': # To use token based authentication auth_key_path = 'AuthKey.p8' auth_file = os.path.join(sys.path[0], auth_key_path) auth_key_id = '************' team_id = '********' token

APNS2 Exception: TooManyProviderTokenUpdates

笑着哭i 提交于 2020-04-30 09:10:25
问题 def process_notification(message): apns = apnsClient apns_response = None try: stream_id = apns.send_notification_async(device_token, apns_payload, target_app) apns_response = apns.get_notification_result(stream_id) except e: logging.error(f"APNS server error occurred.Reason: {apns_response}") if __name__ == '__main__': # To use token based authentication auth_key_path = 'AuthKey.p8' auth_file = os.path.join(sys.path[0], auth_key_path) auth_key_id = '************' team_id = '********' token

APNS2 Exception: TooManyProviderTokenUpdates

一个人想着一个人 提交于 2020-04-30 09:10:14
问题 def process_notification(message): apns = apnsClient apns_response = None try: stream_id = apns.send_notification_async(device_token, apns_payload, target_app) apns_response = apns.get_notification_result(stream_id) except e: logging.error(f"APNS server error occurred.Reason: {apns_response}") if __name__ == '__main__': # To use token based authentication auth_key_path = 'AuthKey.p8' auth_file = os.path.join(sys.path[0], auth_key_path) auth_key_id = '************' team_id = '********' token

PyAPNs and the need to Sleep between Sends

人盡茶涼 提交于 2019-12-08 02:04:25
问题 I am using PyAPNs to send notifications to iOS devices. I am often sending groups of notifications at once. If any of the tokens is bad for any reason, the process will stop. As a result I am using the enhanced setup and the following method: apns.gateway_server.register_response_listener I use this to track which token was the problem and then I pick up from there sending the rest. The issue is that when sending the only way to trap these errors is to use a sleep timer between token sends.

PyAPNs and the need to Sleep between Sends

旧街凉风 提交于 2019-12-06 12:38:31
I am using PyAPNs to send notifications to iOS devices. I am often sending groups of notifications at once. If any of the tokens is bad for any reason, the process will stop. As a result I am using the enhanced setup and the following method: apns.gateway_server.register_response_listener I use this to track which token was the problem and then I pick up from there sending the rest. The issue is that when sending the only way to trap these errors is to use a sleep timer between token sends. For example: for x in self.retryAPNList: apns.gateway_server.send_notification(x, payload, identifier =