mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
APNs: Add message body to notification payload.
(Edited by greg to leave the badge logic as is for now.)
This commit is contained in:
@@ -344,7 +344,10 @@ def get_alert_from_message(message):
|
||||
def get_apns_payload(message):
|
||||
# type: (Message) -> Dict[str, Any]
|
||||
return {
|
||||
'alert': get_alert_from_message(message),
|
||||
'alert': {
|
||||
'title': get_alert_from_message(message),
|
||||
'body': message.content[:200],
|
||||
},
|
||||
# TODO: set badge count in a better way
|
||||
'badge': 1,
|
||||
'custom': {
|
||||
|
||||
@@ -652,7 +652,10 @@ class TestGetAPNsPayload(PushNotificationTest):
|
||||
}
|
||||
payload = apn.get_apns_payload(message)
|
||||
expected = {
|
||||
'alert': "New private group message from King Hamlet",
|
||||
'alert': {
|
||||
'title': "New private group message from King Hamlet",
|
||||
'body': message.content,
|
||||
},
|
||||
'badge': 1,
|
||||
'custom': {
|
||||
'zulip': {
|
||||
|
||||
Reference in New Issue
Block a user