|
@@ -315,6 +315,7 @@ class NotificationView(View):
|
|
|
for up in uid_push_qs:
|
|
|
push_type = up['push_type']
|
|
|
# ios apns
|
|
|
+ print(push_type)
|
|
|
if push_type == 0:
|
|
|
self.do_apns(request_dict, up, response, uid, channel, nickname)
|
|
|
# android gcm
|
|
@@ -442,6 +443,8 @@ class NotificationView(View):
|
|
|
message_title = self.get_message_title(appBundleId=appBundleId, nickname=nickname)
|
|
|
send_text = self.get_send_text(channel=channel, n_time=n_time, lang=lang, tz=tz)
|
|
|
try:
|
|
|
+ print('---')
|
|
|
+
|
|
|
cli = apns2.APNSClient(mode="dev", client_cert=APNS_CONFIG[appBundleId]['pem_path'],
|
|
|
password=APNS_CONFIG[appBundleId]['password'])
|
|
|
push_data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
@@ -453,6 +456,7 @@ class NotificationView(View):
|
|
|
res = cli.push(n=n, device_token=token_val, topic=appBundleId)
|
|
|
# assert res.status_code == 200, res.reason
|
|
|
# assert res.apns_id
|
|
|
+ print('========')
|
|
|
print(res.status_code)
|
|
|
if res.status_code == 200:
|
|
|
return response.json(0)
|