Files
Genarrative/apps/mobile-shell/src/mobileShellLifecycle.ts
T
kdletters 346368f0e7 接入原生壳生命周期事件
新增 app.lifecycle HostBridge 能力与 H5 订阅入口

Expo 壳通过 React Native AppState 注入真实前后台状态

Tauri 壳通过主窗口 focus 和 blur 注入真实激活状态

更新壳能力漂移检查、测试和架构文档
2026-06-18 02:16:47 +08:00

14 lines
321 B
TypeScript

import type { AppStateStatus } from 'react-native';
export function lifecyclePayloadFromAppState(state: AppStateStatus) {
return {
state: state === 'active'
? 'active'
: state === 'background'
? 'background'
: 'inactive',
focused: state === 'active',
nativeState: state,
};
}