diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index aa9d16f9eb..1530575b52 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -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': { diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index 5a964221d9..77f27eac3d 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -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': {