接入原生壳本地通知能力

新增 notification.showLocal HostBridge 契约和 H5 facade

移动端通过 expo-notifications 发送即时本地通知

桌面端通过 Tauri notification 插件发送系统通知

更新壳能力检查、测试、方案文档和共享决策记录
This commit is contained in:
2026-06-18 04:24:55 +08:00
parent f34f98c1a0
commit bbfe4b7181
19 changed files with 685 additions and 7 deletions

View File

@@ -133,6 +133,7 @@ for (const dependency of [
'expo-file-system',
'expo-image-picker',
'expo-network',
'expo-notifications',
'expo-sharing',
]) {
if (!packageConfig.dependencies?.[dependency]) {
@@ -160,12 +161,31 @@ if (Array.isArray(imagePickerPlugin)) {
}
}
const notificationsPlugin = appConfig.plugins?.find((plugin) =>
Array.isArray(plugin) ? plugin[0] === 'expo-notifications' : plugin === 'expo-notifications',
);
if (!notificationsPlugin) {
throw new Error('mobile shell notifications plugin is missing');
}
if (Array.isArray(notificationsPlugin)) {
const pluginOptions = notificationsPlugin[1] ?? {};
if (pluginOptions.enableBackgroundRemoteNotifications !== false) {
throw new Error('mobile shell must not enable background remote notifications');
}
}
for (const snippet of [
'file.exportText',
'file.exportImage',
'file.importImage',
'notification.showLocal',
'network.status',
'getMobileNetworkStatus',
'Notifications.scheduleNotificationAsync',
'Notifications.setNotificationChannelAsync',
'Notifications.getPermissionsAsync',
'Notifications.requestPermissionsAsync',
'Sharing.shareAsync',
'ImagePicker.launchImageLibraryAsync',
'ImagePicker.requestMediaLibraryPermissionsAsync',
@@ -202,6 +222,7 @@ for (const capability of [
'file.exportImage',
'file.importImage',
'haptics.impact',
'notification.showLocal',
]) {
if (!mobileCapabilitySet.has(capability)) {
throw new Error(`mobile shell capabilities missing ${capability}`);