push_notifications: Disable badge counts.

We include tests for the new implementation to avoid churning the
codebase too much so this can be easily reverted when we are able to
re-enable the feature.
This commit is contained in:
Tim Abbott
2020-07-15 22:05:02 -07:00
parent 5a1243db3c
commit 2f66c825a2
3 changed files with 31 additions and 9 deletions

View File

@@ -629,6 +629,14 @@ def get_apns_alert_subtitle(message: Message) -> str:
return message.sender.full_name + ":"
def get_apns_badge_count(user_profile: UserProfile, read_messages_ids: Optional[Sequence[int]]=[]) -> int:
# NOTE: We have temporarily set get_apns_badge_count to always
# return 0 until we can debug a likely mobile app side issue with
# handling notifications while the app is open.
return 0
def get_apns_badge_count_future(user_profile: UserProfile, read_messages_ids: Optional[Sequence[int]]=[]) -> int:
# Future implementation of get_apns_badge_count; unused but
# we expect to use this once we resolve client-side bugs.
return UserMessage.objects.filter(
user_profile=user_profile
).extra(