From 487add9cff904ddf0497f4aad5c6070cbcf1fd8c Mon Sep 17 00:00:00 2001 From: Cassidy Laidlaw Date: Mon, 29 Jun 2020 19:19:32 -0400 Subject: [PATCH] Fix determination of push type for empty notifications with badge=0 --- apns2/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apns2/client.py b/apns2/client.py index baacd61..0947350 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -117,7 +117,11 @@ def send_notification_async(self, token_hex: str, notification: Payload, topic: inferred_push_type = NotificationType.Complication.value elif topic.endswith('.pushkit.fileprovider'): inferred_push_type = NotificationType.FileProvider.value - elif any([notification.alert, notification.badge, notification.sound]): + elif any([ + notification.alert is not None, + notification.badge is not None, + notification.sound is not None, + ]): inferred_push_type = NotificationType.Alert.value else: inferred_push_type = NotificationType.Background.value