chenjunkai 6 жил өмнө
parent
commit
c484f40368

+ 2 - 2
Controller/DetectController.py

@@ -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="Hello, Android msg", priority=1, style=1, alert_type=1,
+        android = jpush.android(alert=send_text, priority=1, style=1, alert_type=1,
                                 big_text=send_text, title=message_title,
                                 extras=push_data)
 
@@ -490,7 +490,7 @@ class NotificationView(View):
             push_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}
             body = json.dumps(push_data)
-            alert = apns2.PayloadAlert(body=body, title=message_title)
+            alert = apns2.PayloadAlert(body=send_text, title=message_title)
             payload = apns2.Payload(alert=alert)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=appBundleId)

+ 1 - 8
Controller/Test.py

@@ -217,17 +217,10 @@ class Test(View):
                                 extras=push_data,title='fffff')
 
         push.notification = jpush.notification(android=android)
-        # push.notification = jpush.notification(alert="uid:xoxoxoxoxoxoxoxoxoxo", android=android)
 
-        # push.notification = jpush.notification(alert="xoxoxoxoxoxoxoxoxoxo")
-        ''''''
-
-
-        # push.message = jpush.message('Motion', extras=push_data, title='KPNS', content_type='text')
-        ''''''
         push.platform = jpush.all_
         try:
-            res = push.send()
+            push.send()
         except Exception as e:
             print("Exception")
             return response.json(10, repr(e))