|
@@ -522,23 +522,32 @@ class PushObject:
|
|
|
'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
|
|
|
}
|
|
|
+
|
|
|
+ # 一键通话通知推送
|
|
|
+ if event_type in [606, 607]:
|
|
|
+ push_data = {
|
|
|
+ "android": {
|
|
|
+ "data": json.dumps(extra_data),
|
|
|
+ "notification": {
|
|
|
+ "body": msg_text,
|
|
|
+ "title": msg_title,
|
|
|
+ "clickAction": {
|
|
|
+ "type": 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "token": [token_val]
|
|
|
+ }
|
|
|
+ response = requests.post(push_url, json=push_data, headers=headers)
|
|
|
+ LOGGER.info("uid{}时间{},荣耀通知推送返回值:{}".format(uid, n_time, response.json()))
|
|
|
+
|
|
|
+ # 透传推送
|
|
|
push_data = {
|
|
|
- "android": {
|
|
|
- # "data": json.dumps(extra_data),
|
|
|
- # "notification": {
|
|
|
- # "body": msg_text,
|
|
|
- # "title": msg_title,
|
|
|
- # "clickAction": {
|
|
|
- # "type": 3
|
|
|
- # }
|
|
|
- # }
|
|
|
- },
|
|
|
"data": json.dumps(extra_data),
|
|
|
- "notification": {},
|
|
|
"token": [token_val]
|
|
|
}
|
|
|
response = requests.post(push_url, json=push_data, headers=headers)
|
|
|
- LOGGER.info("uid{}时间{},荣耀推送返回值:{}".format(uid, n_time, response.json()))
|
|
|
+ LOGGER.info("uid{}时间{},荣耀透传推送返回值:{}".format(uid, n_time, response.json()))
|
|
|
return True
|
|
|
except Exception as e:
|
|
|
LOGGER.info("荣耀推送异常:error_line:{},error_msg:{}".format(e.__traceback__.tb_lineno, repr(e)))
|