fix:APP-push点击文案显示home页
This commit is contained in:
26
server/app/features/push_payload.py
Normal file
26
server/app/features/push_payload.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
|
||||
def build_home_push_data(
|
||||
*,
|
||||
client_user_id: str,
|
||||
body: str,
|
||||
scene: str = "push",
|
||||
content_id: Optional[int] = None,
|
||||
) -> dict[str, Any]:
|
||||
"""
|
||||
构建客户端点击通知后回到 Home 所需的最小 payload。
|
||||
"""
|
||||
|
||||
data: dict[str, Any] = {
|
||||
"client_user_id": str(client_user_id),
|
||||
"scene": str(scene),
|
||||
"target_screen": "home",
|
||||
"deep_link": "client://home",
|
||||
"home_text": str(body),
|
||||
}
|
||||
if content_id is not None:
|
||||
data["content_id"] = int(content_id)
|
||||
return data
|
||||
Reference in New Issue
Block a user