问题
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_credentials = TokenCredentials(auth_key_path=auth_file, auth_key_id=auth_key_id, team_id=team_id)
apnsClient = APNsClient(credentials=token_credentials, use_sandbox=False)
subscriber.subscribe(subscription_name, process_notification, auto_ack_on_received=False)
while True:
time.sleep(60)
- I have two docker PODS running and processing the message in GCP.
- Library used is apns2==0.5.0
Getting:
"Exception: TooManyProviderTokenUpdates"very frequently atleast 3-4 times a day for continuous 1 hour.
What's the miss configuration I have done that is causing the issue?
Could anyone please assist me? Thank you.
来源:https://stackoverflow.com/questions/57911697/apns2-exception-toomanyprovidertokenupdates