APNs: Add message body to notification payload.

(Edited by greg to leave the badge logic as is for now.)
This commit is contained in:
kunall17
2017-09-01 01:57:46 +05:30
committed by Greg Price
parent 02d931a53e
commit 1436d558a3
2 changed files with 8 additions and 2 deletions

View File

@@ -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': {

View File

@@ -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': {