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 或窗口失焦时暂停 `