mirror of https://github.com/zulip/zulip.git
push notif: Set GCM priority `high` for real notifications.
This is the payoff of this branch! Fixes zulip/zulip-mobile#3185.
This commit is contained in:
parent
699bf262ca
commit
ffabebd7f3
|
@ -667,7 +667,7 @@ def handle_push_notification(user_profile_id: int, missed_message: Dict[str, Any
|
|||
|
||||
apns_payload = get_apns_payload(user_profile, message)
|
||||
gcm_payload = get_gcm_payload(user_profile, message)
|
||||
gcm_options = {} # type: Dict[str, Any]
|
||||
gcm_options = {'priority': 'high'} # type: Dict[str, Any]
|
||||
logger.info("Sending push notifications to mobile clients for user %s" % (user_profile_id,))
|
||||
|
||||
if uses_notification_bouncer():
|
||||
|
|
|
@ -646,7 +646,7 @@ class HandlePushNotificationTest(PushNotificationTest):
|
|||
mock_send.assert_called_with(user_profile.id,
|
||||
{'apns': True},
|
||||
{'gcm': True},
|
||||
{},
|
||||
{'priority': 'high'},
|
||||
)
|
||||
|
||||
def test_non_bouncer_push(self) -> None:
|
||||
|
@ -688,7 +688,7 @@ class HandlePushNotificationTest(PushNotificationTest):
|
|||
mock_send_apple.assert_called_with(self.user_profile.id,
|
||||
apple_devices,
|
||||
{'apns': True})
|
||||
mock_send_android.assert_called_with(android_devices, {'gcm': True}, {})
|
||||
mock_send_android.assert_called_with(android_devices, {'gcm': True}, {'priority': 'high'})
|
||||
mock_push_notifications.assert_called_once()
|
||||
|
||||
@override_settings(SEND_REMOVE_PUSH_NOTIFICATIONS=True)
|
||||
|
@ -799,7 +799,7 @@ class HandlePushNotificationTest(PushNotificationTest):
|
|||
mock_send_apple.assert_called_with(self.user_profile.id,
|
||||
apple_devices,
|
||||
{'apns': True})
|
||||
mock_send_android.assert_called_with(android_devices, {'gcm': True}, {})
|
||||
mock_send_android.assert_called_with(android_devices, {'gcm': True}, {'priority': 'high'})
|
||||
mock_push_notifications.assert_called_once()
|
||||
|
||||
class TestAPNs(PushNotificationTest):
|
||||
|
|
Loading…
Reference in New Issue