|
@@ -118,9 +118,9 @@ class PushObject:
|
|
|
@return: None
|
|
|
"""
|
|
|
logger = logging.getLogger('info')
|
|
|
+ pem_path = os.path.join(BASE_DIR, APNS_CONFIG[app_bundle_id]['pem_path'])
|
|
|
+ logger.info('IOS推送: app_bundle_id:{}, pem_path:{}'.format(app_bundle_id, pem_path))
|
|
|
try:
|
|
|
- pem_path = os.path.join(BASE_DIR, APNS_CONFIG[app_bundle_id]['pem_path'])
|
|
|
- logger.info('apns推送app_bundle_id:{}, pem_path:{}'.format(app_bundle_id, pem_path))
|
|
|
cli = apns2.APNSClient(mode=APNS_MODE, client_cert=pem_path)
|
|
|
alert = apns2.PayloadAlert(title=msg_title, body=msg_text, launch_image=launch_image)
|
|
|
push_data = {'alert': 'Motion', 'msg': '', 'sound': '', 'zpush': '1', 'uid': uid, 'channel': channel,
|
|
@@ -136,8 +136,8 @@ class PushObject:
|
|
|
except AssertionError:
|
|
|
pass
|
|
|
except Exception as e:
|
|
|
- logger.info('IOS推送异常{}'.format(repr(e)))
|
|
|
- email_content = '{}服IOS推送异常: {}'.format(CONFIG_INFO, repr(e))
|
|
|
+ logger.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))
|
|
|
+ email_content = '{}服IOS推送异常: {}, 证书路径: {}'.format(CONFIG_INFO, repr(e), pem_path)
|
|
|
S3Email().send_email(email_content, 'servers@ansjer.com')
|
|
|
|
|
|
@staticmethod
|