|
@@ -174,7 +174,7 @@ class PushObject:
|
|
|
LOGGER.info('fcm推送异常:{}'.format(repr(e)))
|
|
|
|
|
|
@staticmethod
|
|
|
- def android_jpush(nickname, app_bundle_id, token_val, n_time, event_type, msg_title, msg_text):
|
|
|
+ def android_jpush(nickname, app_bundle_id, token_val, n_time, event_type, msg_title, msg_text, channel=1):
|
|
|
"""
|
|
|
android 极光 推送
|
|
|
@param nickname: 设备昵称
|
|
@@ -184,6 +184,7 @@ class PushObject:
|
|
|
@param event_type: 事件类型
|
|
|
@param msg_title: 推送标题
|
|
|
@param msg_text: 推送内容
|
|
|
+ @param channel: 设备通道
|
|
|
@return: None
|
|
|
"""
|
|
|
try:
|
|
@@ -193,8 +194,9 @@ class PushObject:
|
|
|
_jpush = jpush.JPush(app_key, master_secret)
|
|
|
push = _jpush.create_push()
|
|
|
push.audience = jpush.registration_id(token_val)
|
|
|
- push_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
|
|
|
- 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname
|
|
|
+ push_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1', 'uid': nickname,
|
|
|
+ 'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
+ 'channel': channel
|
|
|
}
|
|
|
android = jpush.android(title=msg_title, big_text=msg_text, alert=msg_text, extras=push_data,
|
|
|
priority=1, style=1, alert_type=7
|