فهرست منبع

删减vivo图片推送

guanhailong 2 سال پیش
والد
کامیت
7e1675b84d
2فایلهای تغییر یافته به همراه4 افزوده شده و 8 حذف شده
  1. 1 4
      Service/DevicePushService.py
  2. 3 4
      Service/PushService.py

+ 1 - 4
Service/DevicePushService.py

@@ -167,7 +167,7 @@ class DevicePushService:
                 LOGGING.info('APP准备推送:{}, {}'.format(param['uid'], param))
                 # 推送显示图片
                 if (param['is_st'] == 1 or param['is_st'] == 3) and \
-                        (push_type == 0 or push_type == 1 or push_type == 3 or push_type == 4 or push_type == 5):
+                        (push_type == 0 or push_type == 1 or push_type == 3 or push_type == 4):
                     if param['is_st'] == 1:
                         key = '{}/{}/{}.jpeg'.format(param['uid'], param['channel'], param['n_time'])
                     else:
@@ -415,9 +415,6 @@ class DevicePushService:
             elif push_type == 4:
                 PushObject.android_xmpush(uid, appBundleId, token_val, n_time, event_type, msg_title,
                                           msg_text, uid, channel, image_url)
-            elif push_type == 5:
-                PushObject.android_vivopush(uid, appBundleId, token_val, n_time, event_type, msg_title,
-                                            msg_text, uid, channel, image_url)
         except Exception as e:
             LOGGING.info('异常详情,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 

+ 3 - 4
Service/PushService.py

@@ -250,7 +250,7 @@ class PushObject:
 
     @staticmethod
     def android_vivopush(app_bundle_id, token_val, n_time, event_type, msg_title, msg_text,
-                         uid='', channel='1', image='', skip_type='1', nickname=''):
+                         uid='', channel='1', image='', skip_type='4', nickname=''):
         """
         vivo 推送
         @param app_bundle_id: app包id
@@ -274,6 +274,8 @@ class PushObject:
             redisObj = RedisObject()
             # 获取redis里面的authToken
             redis_authToken = redisObj.get_data(key=authToken)
+            if msg_title == '':
+                msg_title = '设备'
             if redis_authToken is not False:
                 app_secret = VIVOPUSH_CONFIG[app_bundle_id]['Secret']
                 sender_send = APISender(app_secret)
@@ -301,10 +303,7 @@ class PushObject:
                 .content(msg_text) \
                 .push_mode(1) \
                 .notify_type(1) \
-                .network_type(-1) \
                 .skip_type(skip_type) \
-                .skip_content('') \
-                .time_to_live(1000) \
                 .request_id('123456') \
                 .classification(1) \
                 .client_custom_map(**push_data) \