From ef5b7afd2c7a56307610cafd27c7e7b4112c00ad Mon Sep 17 00:00:00 2001 From: kdletters Date: Thu, 18 Jun 2026 12:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=81=E5=AE=9A=E7=A7=BB=E5=8A=A8=E5=A3=B3?= =?UTF-8?q?=E5=8D=B3=E6=97=B6=E9=80=9A=E7=9F=A5=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移动壳配置检查拒绝定时和周期通知触发字段 移动壳配置检查固定本地通知只使用 null 或 Android channelId 触发 同步宿主壳方案中的即时通知门禁说明 同步共享决策记录中的通知权限边界 --- apps/mobile-shell/scripts/check-config.mjs | 26 +++++++++++++++++++ .../shared-memory/decision-log.md | 2 +- ...ExpoReactNative与Tauri宿主壳方案-2026-06-17.md | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/apps/mobile-shell/scripts/check-config.mjs b/apps/mobile-shell/scripts/check-config.mjs index b753cef60..c3ea54353 100644 --- a/apps/mobile-shell/scripts/check-config.mjs +++ b/apps/mobile-shell/scripts/check-config.mjs @@ -71,6 +71,23 @@ const blockedMobileChannelSnippets = [ 'posthog.capture', 'posthog.init', ]; +const blockedScheduledNotificationSnippets = [ + 'SchedulableTriggerInputTypes', + 'cancelScheduledNotificationAsync', + 'getAllScheduledNotificationsAsync', + 'getNextTriggerDateAsync', + 'seconds:', + 'repeats:', + "type: 'calendar'", + "type: 'daily'", + "type: 'date'", + "type: 'monthly'", + "type: 'timeInterval'", + "type: 'weekly'", + "type: 'yearly'", + 'DateTriggerInput', + 'TimeIntervalTriggerInput', +]; const blockedAndroidPermissions = [ 'android.permission.MANAGE_EXTERNAL_STORAGE', 'android.permission.READ_EXTERNAL_STORAGE', @@ -568,6 +585,7 @@ for (const forbiddenNotificationSnippet of [ 'getDevicePushTokenAsync', 'addPushTokenListener', 'addNotificationResponseReceivedListener', + ...blockedScheduledNotificationSnippets, ]) { if (bridgeSource.includes(forbiddenNotificationSnippet)) { throw new Error( @@ -576,6 +594,14 @@ for (const forbiddenNotificationSnippet of [ } } +if ( + !/trigger:\s*Platform\.OS === 'android'\s*\?\s*\{\s*channelId: LOCAL_NOTIFICATION_CHANNEL_ID\s*\}\s*:\s*null/.test( + bridgeSource, + ) +) { + throw new Error('mobile shell local notifications must stay immediate and channel-only'); +} + for (const snippet of [ 'file.exportText', 'file.importText', diff --git a/docs/project-memory/shared-memory/decision-log.md b/docs/project-memory/shared-memory/decision-log.md index 2a70ccd71..946c7e078 100644 --- a/docs/project-memory/shared-memory/decision-log.md +++ b/docs/project-memory/shared-memory/decision-log.md @@ -53,7 +53,7 @@ - 2026-06-18 H5 背景音乐接入宿主生命周期:`useBackgroundMusic` 通过 `useHostLifecycleActive()` 消费 `subscribeHostAppLifecycle()` 的归一结果,宿主进入后台、inactive 或桌面窗口失焦时降低音量并暂停音频循环,同时 `suspend` WebAudio context;回到 `active + focused` 且用户原本开启音乐时再恢复播放,不改变用户音量设置。 - 2026-06-18 固定玩法音频接入宿主生命周期:前端新增 `useHostLifecycleActive()` 统一消费 `subscribeHostAppLifecycle()`,`useBackgroundMusic`、拼图运行态和抓大鹅运行态都只依赖该归一状态判断音频可播放性;宿主 inactive、background 或窗口失焦时暂停 `