|
@@ -80,9 +80,9 @@ class NotificationView(View):
|
|
# 一分钟外,推送开启状态
|
|
# 一分钟外,推送开启状态
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
# 暂时注销
|
|
# 暂时注销
|
|
- # if have_pkey:
|
|
|
|
- # res_data = {'code': 0, 'msg': 'success11111111111111!'}
|
|
|
|
- # return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
+ if have_pkey:
|
|
|
|
+ res_data = {'code': 0, 'msg': 'success11111111111111!'}
|
|
|
|
+ return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
# 数据库读取数据
|
|
# 数据库读取数据
|
|
if have_ykey:
|
|
if have_ykey:
|
|
@@ -353,7 +353,7 @@ class NotificationView(View):
|
|
alert = apns2.PayloadAlert(body=msg_text, title=msg_title)
|
|
alert = apns2.PayloadAlert(body=msg_text, title=msg_title)
|
|
payload = apns2.Payload(alert=alert, custom=push_data)
|
|
payload = apns2.Payload(alert=alert, custom=push_data)
|
|
|
|
|
|
- return uid, channel, appBundleId, token_val, event_type, n_time, msg_title,msg_text
|
|
|
|
|
|
+ return uid, channel, appBundleId, str(token_val), event_type, n_time, msg_title,msg_text
|
|
n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
|
|
n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
|
|
res = cli.push(n=n, device_token=token_val, topic=appBundleId)
|
|
res = cli.push(n=n, device_token=token_val, topic=appBundleId)
|
|
print(res.status_code)
|
|
print(res.status_code)
|