瀏覽代碼

打印推送对象值

locky 2 年之前
父節點
當前提交
250c160682
共有 1 個文件被更改,包括 19 次插入1 次删除
  1. 19 1
      Service/HuaweiPushService/HuaweiPushService.py

+ 19 - 1
Service/HuaweiPushService/HuaweiPushService.py

@@ -72,6 +72,13 @@ class HuaweiPushObject:
         intent = 'intent://com.vivo.pushvideo/detail?#Intent;scheme=vpushscheme;launchFlags=0x10000000;S.uid={};S.event_type={};S.event_time={};end'.format(
             uid, event_type, n_time)
         android_notification = self.android_notification(msg_title, msg_text, intent)
+
+        android_notification_attributes = dir(android_notification)
+        for attr in android_notification_attributes:
+            if not attr.startswith('__') and not attr.endswith('__'):
+                value = getattr(android_notification, attr)
+                LOGGER.info('android_notification_attributes {}: {}'.format(attr, value))
+
         # 安卓配置
         android = messaging.AndroidConfig(
             data=data,
@@ -83,12 +90,23 @@ class HuaweiPushObject:
             category='DEVICE_REMINDER'
         )
 
+        android_attributes = dir(android)
+        for attr in android_attributes:
+            if not attr.startswith('__') and not attr.endswith('__'):
+                value = getattr(android_attributes, attr)
+                LOGGER.info('android_attributes {}: {}'.format(attr, value))
+
         message = messaging.Message(
             notification=notification,
             android=android,
             token=[token_val]
         )
-        LOGGER.info('通知栏推送category:{}'.format(message.android.category))
+
+        message_attributes = dir(message)
+        for attr in message_attributes:
+            if not attr.startswith('__') and not attr.endswith('__'):
+                value = getattr(message_attributes, attr)
+                LOGGER.info('message_attributes {}: {}'.format(attr, value))
 
         try:
             import certifi