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:
Greg Price
2019-02-07 17:16:42 -08:00
committed by Tim Abbott
parent 699bf262ca
commit ffabebd7f3
2 changed files with 4 additions and 4 deletions

View File

@@ -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) apns_payload = get_apns_payload(user_profile, message)
gcm_payload = get_gcm_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,)) logger.info("Sending push notifications to mobile clients for user %s" % (user_profile_id,))
if uses_notification_bouncer(): if uses_notification_bouncer():

View File

@@ -646,7 +646,7 @@ class HandlePushNotificationTest(PushNotificationTest):
mock_send.assert_called_with(user_profile.id, mock_send.assert_called_with(user_profile.id,
{'apns': True}, {'apns': True},
{'gcm': True}, {'gcm': True},
{}, {'priority': 'high'},
) )
def test_non_bouncer_push(self) -> None: def test_non_bouncer_push(self) -> None:
@@ -688,7 +688,7 @@ class HandlePushNotificationTest(PushNotificationTest):
mock_send_apple.assert_called_with(self.user_profile.id, mock_send_apple.assert_called_with(self.user_profile.id,
apple_devices, apple_devices,
{'apns': True}) {'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() mock_push_notifications.assert_called_once()
@override_settings(SEND_REMOVE_PUSH_NOTIFICATIONS=True) @override_settings(SEND_REMOVE_PUSH_NOTIFICATIONS=True)
@@ -799,7 +799,7 @@ class HandlePushNotificationTest(PushNotificationTest):
mock_send_apple.assert_called_with(self.user_profile.id, mock_send_apple.assert_called_with(self.user_profile.id,
apple_devices, apple_devices,
{'apns': True}) {'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() mock_push_notifications.assert_called_once()
class TestAPNs(PushNotificationTest): class TestAPNs(PushNotificationTest):