|
@@ -372,7 +372,7 @@ class NotificationView(View):
|
|
|
else:
|
|
|
message_title = "zosi({uid})".format(uid=uid)
|
|
|
send_text = 'channel:{channel} date:{date}'.format(channel=channel, date=n_date)
|
|
|
- android = jpush.android(alert=send_text, priority=1, style=1, alert_type=1,
|
|
|
+ android = jpush.android(alert=send_text, priority=1, style=1, alert_type=7,
|
|
|
big_text=send_text, title=message_title,
|
|
|
extras=push_data)
|
|
|
|
|
@@ -455,7 +455,12 @@ class NotificationView(View):
|
|
|
data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
|
"received_at": n_time, "sound": "sound.aif", "uid": uid, "zpush": "1", "channel": channel}
|
|
|
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title,
|
|
|
- message_body=send_text, data_message=data)
|
|
|
+ message_body=send_text, data_message=data,
|
|
|
+ extra_kwargs={
|
|
|
+ 'default_vibrate_timings': True,
|
|
|
+ 'default_sound': True,
|
|
|
+ 'default_light_settings': True
|
|
|
+ })
|
|
|
response = ResponseObject()
|
|
|
return response.json(0, result)
|
|
|
|
|
@@ -491,7 +496,7 @@ class NotificationView(View):
|
|
|
"received_at": n_time, "sound": "sound.aif", "uid": uid, "zpush": "1", "channel": channel}
|
|
|
# body = json.dumps(push_data)
|
|
|
alert = apns2.PayloadAlert(body=send_text, title=message_title)
|
|
|
- payload = apns2.Payload(alert=alert,custom=push_data)
|
|
|
+ payload = apns2.Payload(alert=alert, custom=push_data)
|
|
|
n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
|
|
|
res = cli.push(n=n, device_token=token_val, topic=appBundleId)
|
|
|
# assert res.status_code == 200, res.reason
|