|
@@ -54,12 +54,12 @@ class DetectControllerView(View):
|
|
alert = apns2.PayloadAlert(body="body!", title="title!")
|
|
alert = apns2.PayloadAlert(body="body!", title="title!")
|
|
payload = apns2.Payload(alert=alert)
|
|
payload = apns2.Payload(alert=alert)
|
|
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=device_token)
|
|
|
|
|
|
+ res = cli.push(n=n, device_token=device_token, topic='com.ansjer.zsavcloud')
|
|
# assert res.status_code == 200, res.reason
|
|
# assert res.status_code == 200, res.reason
|
|
# assert res.apns_id
|
|
# assert res.apns_id
|
|
if res.status_code == 200:
|
|
if res.status_code == 200:
|
|
return response.json(0)
|
|
return response.json(0)
|
|
else:
|
|
else:
|
|
- return response.json(404,res.reason)
|
|
|
|
|
|
+ return response.json(404, res.reason)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(10, repr(e))
|
|
return response.json(10, repr(e))
|