接入原生壳应用角标能力
新增 HostBridge app.setBadgeCount 契约和 H5 能力门控 Expo 壳按平台声明能力并在 iOS 调用系统角标 API Tauri 壳通过主窗口设置任务栏角标并校验 payload 补齐角标能力测试、漂移检查和架构文档
This commit is contained in:
@@ -23,4 +23,28 @@ describe('buildMobileShellUrl', () => {
|
||||
);
|
||||
expect(url.searchParams.get('work')).toBe('PZ-1');
|
||||
});
|
||||
|
||||
test('支持按平台注入不同能力清单', () => {
|
||||
const iosUrl = new URL(
|
||||
buildMobileShellUrl('https://app.test/', {
|
||||
platform: 'ios',
|
||||
hostVersion: '0.1.0',
|
||||
capabilities: ['host.getRuntime', 'app.setBadgeCount'],
|
||||
}),
|
||||
);
|
||||
const androidUrl = new URL(
|
||||
buildMobileShellUrl('https://app.test/', {
|
||||
platform: 'android',
|
||||
hostVersion: '0.1.0',
|
||||
capabilities: ['host.getRuntime'],
|
||||
}),
|
||||
);
|
||||
|
||||
expect(iosUrl.searchParams.get('hostCapabilities')).toBe(
|
||||
'host.getRuntime,app.setBadgeCount',
|
||||
);
|
||||
expect(androidUrl.searchParams.get('hostCapabilities')).toBe(
|
||||
'host.getRuntime',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user