push notif: Add GCM options to bouncer API; empty for now.

The first use case for this will be setting `priority`,
coming up shortly.
This commit is contained in:
Greg Price
2018-11-29 12:37:40 -08:00
committed by Tim Abbott
parent 3470e541c8
commit 49fd2e65de
3 changed files with 71 additions and 24 deletions

View File

@@ -128,6 +128,7 @@ def remote_server_notify_push(request: HttpRequest, entity: Union[UserProfile, R
user_id = payload['user_id']
gcm_payload = payload['gcm_payload']
apns_payload = payload['apns_payload']
gcm_options = payload.get('gcm_options', {})
android_devices = list(RemotePushDeviceToken.objects.filter(
user_id=user_id,
@@ -142,7 +143,7 @@ def remote_server_notify_push(request: HttpRequest, entity: Union[UserProfile, R
))
if android_devices:
send_android_push_notification(android_devices, gcm_payload, remote=True)
send_android_push_notification(android_devices, gcm_payload, gcm_options, remote=True)
if apple_devices:
send_apple_push_notification(user_id, apple_devices, apns_payload, remote=True)