소스 검색

华为推送607透传

locky 1 년 전
부모
커밋
ec76f771fa
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      Service/HuaweiPushService/HuaweiPushService.py

+ 8 - 4
Service/HuaweiPushService/HuaweiPushService.py

@@ -35,11 +35,11 @@ class HuaweiPushObject:
         @return:
         """
         LOGGER.info(
-            '华为推送参数: token_val:{}, msg_title:{}, msg_text:{}, image_url:{}, uid:{}, event_type:{}, n_time:{}'.format(
-                token_val, msg_title, msg_text, image_url, uid, event_type, n_time))
+            '华为推送参数: uid:{}, token_val:{}, msg_title:{}, msg_text:{}, image_url:{}, event_type:{}, n_time:{}'.format(
+                uid, token_val, msg_title, msg_text, image_url, event_type, n_time))
 
         self.send_notify_message(msg_title, msg_text, image_url, uid, nickname, event_type, n_time, token_val)
-        if int(event_type) == 606:
+        if int(event_type) in [606, 607]:
             self.send_data_message(uid, event_type, n_time, token_val)
 
     def send_notify_message(self, msg_title, msg_text, image_url, uid, nickname, event_type, n_time, token_val):
@@ -159,5 +159,9 @@ class HuaweiPushObject:
             badge=messaging.AndroidBadgeNotification(
                 add_num=1, clazz='Classic'),
             visibility=messaging.AndroidNotification.PUBLIC,
-            foreground_show=False
+            foreground_show=False,
+            # buttons=[
+            #     {'name': '接听', 'action_type': 1},
+            #     {'name': '拒绝', 'action_type': 3}
+            # ]
         )