|
@@ -271,7 +271,7 @@ class NotificationView(View):
|
|
|
print(app_key)
|
|
|
print(master_secret)
|
|
|
print('=============')
|
|
|
- # 此处换成各自的app_key和master_secret
|
|
|
+ # 此处换成各自的app_key和master_secre
|
|
|
_jpush = jpush.JPush(app_key, master_secret)
|
|
|
push = _jpush.create_push()
|
|
|
# if you set the logging level to "DEBUG",it will show the debug logging.
|
|
@@ -279,7 +279,7 @@ class NotificationView(View):
|
|
|
# push.audience = jpush.all_
|
|
|
push.audience = jpush.registration_id(token_val)
|
|
|
push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
|
- "received_at": n_time, "sound": "sound.aif", "uid": uid}
|
|
|
+ "received_at": n_time, "sound": "sound.aif", "uid": uid,"zpush":"1"}
|
|
|
push_msg = json.dumps(push_data)
|
|
|
# push.notification = jpush.notification(alert="hello jpush api")
|
|
|
# push.notification = jpush.notification(alert=push_msg)
|
|
@@ -315,7 +315,7 @@ class NotificationView(View):
|
|
|
serverKey = gcm_config[appBundleId]
|
|
|
event_type = request_dict.get('event_type', None)
|
|
|
push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
|
- "received_at": n_time, "sound": "sound.aif", "uid": uid}
|
|
|
+ "received_at": n_time, "sound": "sound.aif", "uid": uid,"zpush":"1"}
|
|
|
json_data = {
|
|
|
"collapse_key": "WhatYouWant",
|
|
|
"data": push_data,
|