Skip to content

Commit 8494361

Browse files
cassidylaidlawPr0Ger
authored andcommitted
Fix determination of push type for empty notifications with badge=0
1 parent e60ca8c commit 8494361

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apns2/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ def send_notification_async(self, token_hex: str, notification: Payload, topic:
117117
inferred_push_type = NotificationType.Complication.value
118118
elif topic.endswith('.pushkit.fileprovider'):
119119
inferred_push_type = NotificationType.FileProvider.value
120-
elif any([notification.alert, notification.badge, notification.sound]):
120+
elif any([
121+
notification.alert is not None,
122+
notification.badge is not None,
123+
notification.sound is not None,
124+
]):
121125
inferred_push_type = NotificationType.Alert.value
122126
else:
123127
inferred_push_type = NotificationType.Background.value

0 commit comments

Comments
 (0)