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_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)
  1. I have two docker PODS running and processing the message in GCP.
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!