|
@@ -88,13 +88,15 @@ class Test(View):
|
|
# Your api-key can be gotten from: https://console.firebase.google.com/project/<project-name>/settings/cloudmessaging
|
|
# Your api-key can be gotten from: https://console.firebase.google.com/project/<project-name>/settings/cloudmessaging
|
|
|
|
|
|
registration_id = rg_id
|
|
registration_id = rg_id
|
|
- message_title = "Uber update"
|
|
|
|
|
|
+ message_title = "Zosi Smart(Camera 007)"
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
data = {"alert": "Motion ", "event_time": now_time, "event_type": "51", "msg": "",
|
|
data = {"alert": "Motion ", "event_time": now_time, "event_type": "51", "msg": "",
|
|
"received_at": now_time, "sound": "sound.aif", "uid": "XFDJUHUIOKJHYTGSFFDR", "zpush": "1"}
|
|
"received_at": now_time, "sound": "sound.aif", "uid": "XFDJUHUIOKJHYTGSFFDR", "zpush": "1"}
|
|
- message_body = json.dumps(data)
|
|
|
|
|
|
+ # message_body = json.dumps(data)
|
|
|
|
+
|
|
|
|
+ message_body = '警告:Motion Channel:1 日期:{tt}'.format(tt=str(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(time.time()))))
|
|
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title,
|
|
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title,
|
|
- message_body=message_body)
|
|
|
|
|
|
+ message_body=message_body,data_message=data)
|
|
from var_dump import var_dump
|
|
from var_dump import var_dump
|
|
var_dump(result)
|
|
var_dump(result)
|
|
|
|
|