ソースを参照

追加苹果日志

peng 1 年間 前
コミット
966bbafdb1
1 ファイル変更4 行追加2 行削除
  1. 4 2
      Service/PushService.py

+ 4 - 2
Service/PushService.py

@@ -132,7 +132,8 @@ class PushObject:
                                     mutable_content=True)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)
-            LOGGER.info('IOS推送响应状态码{},params,uid:{},{}'.format(res.status_code, uid, json.dumps(push_data)))
+            LOGGER.info(
+                'IOS推送响应状态码{},params,uid:{},{},推送结果:{}'.format(res.status_code, uid, json.dumps(push_data), res))
             assert res.status_code == 200
             return True
         except Exception as e:
@@ -531,7 +532,8 @@ class PushObject:
             headers = {'Content-Type': 'application/json', 'Authorization': authorization_token,
                        'timestamp': str(int(time.time()) * 1000)}
             extra_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
-                          'received_at': n_time, 'event_time': n_time, 'event_type': str(event_type), 'nickname': nickname,
+                          'received_at': n_time, 'event_time': n_time, 'event_type': str(event_type),
+                          'nickname': nickname,
                           'uid': uid, 'channel': channel, 'title': msg_title, 'body': msg_text
                           }
             # 通知推送