chenjunkai 6 years ago
parent
commit
31fc63e3f2
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Controller/Test.py

+ 5 - 3
Controller/Test.py

@@ -88,13 +88,15 @@ class Test(View):
         # Your api-key can be gotten from:  https://console.firebase.google.com/project/<project-name>/settings/cloudmessaging
 
         registration_id = rg_id
-        message_title = "Uber update"
+        message_title = "Zosi Smart(Camera 007)"
         now_time = int(time.time())
         data = {"alert": "Motion ", "event_time": now_time, "event_type": "51", "msg": "",
                 "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,
-                                                   message_body=message_body)
+                                                   message_body=message_body,data_message=data)
         from var_dump import var_dump
         var_dump(result)