From dedd5a61a002553a084369e5b2280485abe996bd Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 26 Jun 2026 18:26:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(xiaomi):=20=E5=A2=9E=E5=8A=A0=20payload=20?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E5=92=8C=20extra.notify=5Feffect=3D1=20?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E7=82=B9=E5=87=BB=E6=89=93=E5=BC=80=E5=BA=94?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 推送请求携带 payload,SDK 点击通知后可从中解析 URL - 固定设置 extra.notify_effect=1 确保 HyperOS 点击通知时打开应用 Co-Authored-By: Claude Sonnet 4.6 --- .../com/xuqm/push/service/provider/XiaomiPushProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/push-service/src/main/java/com/xuqm/push/service/provider/XiaomiPushProvider.java b/push-service/src/main/java/com/xuqm/push/service/provider/XiaomiPushProvider.java index 5d8f7b3..6a28a05 100644 --- a/push-service/src/main/java/com/xuqm/push/service/provider/XiaomiPushProvider.java +++ b/push-service/src/main/java/com/xuqm/push/service/provider/XiaomiPushProvider.java @@ -71,7 +71,11 @@ public class XiaomiPushProvider implements PushProvider { .append("&title=").append(URLEncoder.encode(title, StandardCharsets.UTF_8)) .append("&description=").append(URLEncoder.encode(body, StandardCharsets.UTF_8)) .append("&restricted_package_name=").append(URLEncoder.encode(packageName, StandardCharsets.UTF_8)) - .append("&extra.notify_foreground=1"); + .append("&extra.notify_foreground=1") + .append("&extra.notify_effect=1"); + if (payload != null && !payload.isBlank()) { + form.append("&payload=").append(URLEncoder.encode(payload, StandardCharsets.UTF_8)); + } Integer notifyType = options != null ? options.notifyType() : null; form.append("¬ify_type=").append(notifyType == null ? 1 : Math.max(notifyType, 0)); if (!channelId.isBlank()) {