alert = IOSPayloadAlert(title=f"Call From {name}", subtitle='Incoming call', body=f'Incoming call from {name}')
payload = IOSPayload(alert=alert)
notification = IOSNotification(payload=payload, topic='com.company.app', push_type="voip",)
with APNSClient(mode=APNSClient.MODE_PROD, authentificator=TokenBasedAuth( auth_key_path=f"{settings.APNS_AUTH_KEY}", auth_key_id=settings.APNS_KEY_ID, team_id='XXXXXXX' ), root_cert_path=None,)
as client:
try:
client.push(notification=notification, device_token=apn_token)
except UnregisteredException as e:
logger.info(f'device is unregistered, compare timestamp {e.timestamp_datetime} and remove from db')
except APNSDeviceException:
logger.info('flag the device as potentially invalid and remove from db after a few tries')
except APNSServerException:
logger.info(f"try again later")
except APNSProgrammingException:
logger.info('check your code and try again later')
else:
logger.info('everything is ok')
with APNSClient(mode=APNSClient.MODE_PROD, authentificator=TokenBasedAuth( auth_key_path=f"{settings.APNS_AUTH_KEY}", auth_key_id=settings.APNS_KEY_ID, team_id='XXXXXXX' ), root_cert_path=None,)
I don't understand why this error is showing.