aioapns
aioapns copied to clipboard
send_notification now takes a function that is called on error.
You can now pass a function as error_func
that will get called when send_notification
fails.
Example:
async def error_func(notification_id, response, device_token=device_token):
await mark_tokens_as_invalid(device_token)
return print(
f'deregistering {device_token}')
await apns_client.send_notification(request, error_func=error_func)