|
@@ -100,12 +100,18 @@ class Test(View):
|
|
message_body = '警告:Motion Channel:1 日期:{tt}'.format(
|
|
message_body = '警告:Motion Channel:1 日期:{tt}'.format(
|
|
tt=str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))))
|
|
tt=str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))))
|
|
print(message_body)
|
|
print(message_body)
|
|
|
|
+ from var_dump import var_dump
|
|
if push_type == '1':
|
|
if push_type == '1':
|
|
|
|
+ var_dump('1111111')
|
|
result = push_service.single_device_data_message(registration_id=registration_id, data_message=data)
|
|
result = push_service.single_device_data_message(registration_id=registration_id, data_message=data)
|
|
elif push_type == '2':
|
|
elif push_type == '2':
|
|
|
|
+ var_dump('22222222')
|
|
|
|
+
|
|
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, data_message=data,time_to_live=3600)
|
|
message_body=message_body, data_message=data,time_to_live=3600)
|
|
else:
|
|
else:
|
|
|
|
+ var_dump('333333')
|
|
|
|
+
|
|
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)
|
|
|
|
|