Procházet zdrojové kódy

修改华为推送显示内容

locky před 2 roky
rodič
revize
a259eda752

+ 1 - 1
Service/DevicePushService.py

@@ -465,7 +465,7 @@ class DevicePushService:
                                             msg_text, uid, channel, image_url)
             elif push_type == 3:
                 huawei_push_object = HuaweiPushObject()
-                huawei_push_object.send_push_notify_message(nickname=uid, msg_title=msg_title, msg_text=msg_text,
+                huawei_push_object.send_push_notify_message(msg_title=msg_title, msg_text=msg_text,
                                                             image_url=image_url, token_val=token_val)
             elif push_type == 4:
                 PushObject.android_xmpush(uid, appBundleId, token_val, n_time, event_type, msg_title,

+ 4 - 4
Service/HuaweiPushService/HuaweiPushService.py

@@ -16,7 +16,7 @@ class HuaweiPushObject:
         """init sdk app"""
         push_admin.initialize_app(self.app_id, self.app_secret)
 
-    def send_push_notify_message(self, nickname, msg_title, msg_text, image_url, token_val):
+    def send_push_notify_message(self, msg_title, msg_text, image_url, token_val):
         """
         发送推送消息
 
@@ -30,7 +30,7 @@ class HuaweiPushObject:
             image=image_url
         )
         # 推送通知内容配置
-        android_notification = self.android_notification(nickname, msg_title, msg_text)
+        android_notification = self.android_notification(msg_title, msg_text)
         # 安卓配置
         android = messaging.AndroidConfig(
             collapse_key=-1,
@@ -61,7 +61,7 @@ class HuaweiPushObject:
             print(repr(e))
 
     @staticmethod
-    def android_notification(nickname, msg_title, msg_text):
+    def android_notification(msg_title, msg_text):
         return messaging.AndroidNotification(
             icon='/raw/ic_launcher2',
             color='#AACCDD',
@@ -76,7 +76,7 @@ class HuaweiPushObject:
             title_loc_key='M.String.title',
             title_loc_args=['Girl', 'Cat'],
             channel_id='1',
-            notify_summary=nickname,
+            notify_summary='',
             multi_lang_key={'title_key': {'en': 'value1'}, 'body_key': {'en': 'value2'}},
             style=0,
             big_title=msg_title,