|
@@ -345,7 +345,7 @@ class NotificationView(View):
|
|
|
|
|
|
def do_apns(self, uid, channel, appBundleId, token_val, event_type, n_time, msg_title,
|
|
def do_apns(self, uid, channel, appBundleId, token_val, event_type, n_time, msg_title,
|
|
msg_text):
|
|
msg_text):
|
|
- try:
|
|
|
|
|
|
+ # try:
|
|
cli = apns2.APNSClient(mode=APNS_MODE,
|
|
cli = apns2.APNSClient(mode=APNS_MODE,
|
|
client_cert=os.path.join(BASE_DIR, APNS_CONFIG[appBundleId]['pem_path']))
|
|
client_cert=os.path.join(BASE_DIR, APNS_CONFIG[appBundleId]['pem_path']))
|
|
push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
@@ -363,11 +363,11 @@ class NotificationView(View):
|
|
print('apns push fail')
|
|
print('apns push fail')
|
|
print(res.reason)
|
|
print(res.reason)
|
|
return
|
|
return
|
|
- except (ValueError, ArithmeticError):
|
|
|
|
- return 'The program has a numeric format exception, one of the arithmetic exceptions'
|
|
|
|
- except Exception as e:
|
|
|
|
- print(repr(e))
|
|
|
|
- return repr(e)
|
|
|
|
|
|
+ # except (ValueError, ArithmeticError):
|
|
|
|
+ # return 'The program has a numeric format exception, one of the arithmetic exceptions'
|
|
|
|
+ # except Exception as e:
|
|
|
|
+ # print(repr(e))
|
|
|
|
+ # return repr(e)
|
|
|
|
|
|
|
|
|
|
# http://test.dvema.com/detect/add?uidToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJQMldOR0pSRDJFSEE1RVU5MTExQSJ9.xOCI5lerk8JOs5OcAzunrKCfCrtuPIZ3AnkMmnd-bPY&n_time=1526845794&channel=1&event_type=51&is_st=0
|
|
# http://test.dvema.com/detect/add?uidToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJQMldOR0pSRDJFSEE1RVU5MTExQSJ9.xOCI5lerk8JOs5OcAzunrKCfCrtuPIZ3AnkMmnd-bPY&n_time=1526845794&channel=1&event_type=51&is_st=0
|