From ff9f91d341540d3b1c0112df727a224e75d63bbb Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 26 Jun 2026 18:15:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(xiaomi):=20=E4=BF=AE=E5=A4=8D=20HyperOS=20?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF=EF=BC=88?= =?UTF-8?q?channel=5Fid=20=E2=86=92=20extra.channel=5Fid=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 旧 API 用 channel_id 字段,HyperOS V3 API 要求改用 extra.channel_id。 错误参数名导致所有小米推送返回 27001(channel相关信息不匹配)。 Co-Authored-By: Claude Sonnet 4.6 --- .../com/xuqm/push/service/provider/XiaomiPushProvider.java | 3 ++- 1 file changed, 2 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 53db253..5d8f7b3 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 @@ -75,7 +75,8 @@ public class XiaomiPushProvider implements PushProvider { Integer notifyType = options != null ? options.notifyType() : null; form.append("¬ify_type=").append(notifyType == null ? 1 : Math.max(notifyType, 0)); if (!channelId.isBlank()) { - form.append("&channel_id=").append(URLEncoder.encode(channelId, StandardCharsets.UTF_8)); + // HyperOS V3 API requires extra.channel_id (not channel_id) + form.append("&extra.channel_id=").append(URLEncoder.encode(channelId, StandardCharsets.UTF_8)); } log.info("Xiaomi push request: pkg={} channelId={} notifyType={} tokenPrefix={}", packageName, channelId.isBlank() ? "(none)" : channelId,