소스 검색

android fcm推送V1添加推送标题

linhaohong 1 년 전
부모
커밋
2fe46d1337
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Service/PushService.py

+ 5 - 1
Service/PushService.py

@@ -214,12 +214,16 @@ class PushObject:
                 push_data['content_available'] = True
                 push_data['direct_boot_ok'] = True
             message = messaging.Message(
+                notification=messaging.Notification(
+                    title=msg_title,
+                    body=msg_text
+                ),
                 data=push_data,
                 token=token_val,
             )
             # Send a message to the device corresponding to the provided
             # registration token.
-            result = messaging.send(message)
+            result = messaging.send(message, dry_run=True)
             LOGGER.info('fcm推送结果:{}'.format(result))
             return True
         except Exception as e: