Skip to content

Commit

Permalink
Play 'default' sound for iOS notifications.
Browse files Browse the repository at this point in the history
Fixes zulip/zulip-mobile#2651.

This was tested on an iPhone 7 running iOS 12.
  • Loading branch information
jackrzhang committed Nov 2, 2018
1 parent 1490653 commit d5b1a3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions zerver/lib/push_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ def get_apns_payload(user_profile: UserProfile, message: Message) -> Dict[str, A
'subtitle': get_apns_alert_subtitle(message),
'body': content,
},
'sound': 'default',
'badge': 0, # TODO: set badge count in a better way
'custom': {'zulip': zulip_data},
}
Expand Down
5 changes: 5 additions & 0 deletions zerver/tests/test_push_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ def test_get_apns_payload_personal_message(self) -> None:
'body': message.content,
},
'badge': 0,
'sound': 'default',
'custom': {
'zulip': {
'message_ids': [message.id],
Expand Down Expand Up @@ -778,6 +779,7 @@ def test_get_apns_payload_huddle_message(self) -> None:
'subtitle': 'King Hamlet:',
'body': message.content,
},
'sound': 'default',
'badge': 0,
'custom': {
'zulip': {
Expand Down Expand Up @@ -811,6 +813,7 @@ def test_get_apns_payload_stream_message(self):
'subtitle': 'King Hamlet:',
'body': message.content,
},
'sound': 'default',
'badge': 0,
'custom': {
'zulip': {
Expand Down Expand Up @@ -842,6 +845,7 @@ def test_get_apns_payload_stream_mention(self):
'subtitle': 'King Hamlet mentioned you:',
'body': message.content,
},
'sound': 'default',
'badge': 0,
'custom': {
'zulip': {
Expand Down Expand Up @@ -874,6 +878,7 @@ def test_get_apns_payload_redacted_content(self) -> None:
'subtitle': "King Hamlet:",
'body': "***REDACTED***",
},
'sound': 'default',
'badge': 0,
'custom': {
'zulip': {
Expand Down

0 comments on commit d5b1a3a

Please sign in to comment.