|
@@ -303,19 +303,21 @@ class PushObject:
|
|
|
# 推送 push_mode: 推送模式 (0:正式推送;1:测试推送,默认为0)
|
|
|
# 推送 event_type: 消息类型 (0:运营类消息,1:系统类消息。默认为 0)
|
|
|
# 推送 skip_type: 跳转类型(1:打开 APP 首页 2:打开链接 3:自定义 4:打开 app 内指定页面)
|
|
|
+ activity = 'com.ansjer.zccloud_a.AJ_MainView.AJ_Home.AJMainActivity'
|
|
|
message = PushMessage() \
|
|
|
.reg_id(token_val) \
|
|
|
.title(msg_title) \
|
|
|
.content(msg_text) \
|
|
|
.push_mode(0) \
|
|
|
.notify_type(3) \
|
|
|
- .skip_type(1) \
|
|
|
+ .skip_type(4) \
|
|
|
+ .skip_content(activity) \
|
|
|
.request_id(m_code) \
|
|
|
.classification(1) \
|
|
|
.client_custom_map(**push_data) \
|
|
|
.message_dict()
|
|
|
rec = sender_send.send(message)
|
|
|
- logger.info('vivo推送结果:{}, regId{}, 设备uid:{}, 用户昵称:{}'.format(rec, token_val, uid, nickname))
|
|
|
+ logger.info('vivo推送结果:{}, 设备uid:{}'.format(rec, uid))
|
|
|
return rec
|
|
|
except Exception as e:
|
|
|
logger.info('vivo推送异常:{}'.format(e))
|
|
@@ -366,9 +368,9 @@ class PushObject:
|
|
|
# 发送推送
|
|
|
push_url = url + 'server/v1/message/notification/unicast'
|
|
|
extra_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
|
|
|
- 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
- 'uid': uid, 'channel': channel
|
|
|
- }
|
|
|
+ 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
+ 'uid': uid, 'channel': channel
|
|
|
+ }
|
|
|
message = {
|
|
|
"target_type": 2,
|
|
|
"target_value": token_val,
|
|
@@ -418,15 +420,20 @@ class PushObject:
|
|
|
appSecret = MEIZUPUSH_CONFIG[app_bundle_id]['AppSecret']
|
|
|
url = 'https://server-api-push.meizu.com/garcia/api/server/push/varnished/pushByPushId'
|
|
|
extra_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
|
|
|
- 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
- 'uid': uid, 'channel': channel
|
|
|
- }
|
|
|
+ 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
+ 'uid': uid, 'channel': channel
|
|
|
+ }
|
|
|
+ # 转换为json格式
|
|
|
+ extra_data = json.dumps(extra_data)
|
|
|
if msg_title == '':
|
|
|
msg_title = APP_BUNDLE_DICT[app_bundle_id]
|
|
|
# 拼接发送内容
|
|
|
- messageJson = '{"clickTypeInfo":{"activity":"","clickType":0,"customAttribute":""},"extra":{},'
|
|
|
+ activity = "com.ansjer.zccloud_a.AJ_MainView.AJ_Home.AJMainActivity" # 应用页面地址
|
|
|
+ # clickType点击动作, 0打开应用, 1打开应用页面, 2打开url页面, 3应用客户端自定义
|
|
|
+ messageJson = '{"clickTypeInfo": {"activity": "%s",' \
|
|
|
+ '"clickType": 1, "parameters": %s },"extra": {},' % (activity, extra_data)
|
|
|
noticeBarInfo = ('"noticeBarInfo": {"title": "%s", "content": "%s"},' % (msg_title, msg_text))
|
|
|
- noticeExpandInfo = '"noticeExpandInfo":{"noticeExpandType":0},"pushTimeInfo":{"validTime":24}}'
|
|
|
+ noticeExpandInfo = '"noticeExpandInfo": {"noticeExpandType": 0}, "pushTimeInfo": {"validTime": 24}}'
|
|
|
messageJson += noticeBarInfo
|
|
|
messageJson += noticeExpandInfo
|
|
|
data_meizu = {
|