chenjunkai 6 жил өмнө
parent
commit
101587b335

+ 2 - 2
Controller/DetectController.py

@@ -489,9 +489,9 @@ class NotificationView(View):
                                    password=apns_config[appBundleId]['password'])
             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)
+            # body = json.dumps(push_data)
             alert = apns2.PayloadAlert(body=send_text, title=message_title)
-            payload = apns2.Payload(alert=alert)
+            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