feat(APKUpdate): implement APK update check and enhance build workflow
- Added `expo-intent-launcher` dependency to support APK launching functionality. - Introduced `APKUpdateBootstrap` component to check for APK updates during app initialization. - Enhanced build workflow in `build.yml` to resolve runtime version and upload APK to the updates server. - Updated `HomeScreen` and `TabsLayout` to manage tab visibility and scroll behavior based on user interactions. - Refactored message bubble styles for improved UI consistency and user experience.
This commit is contained in:
@@ -21,6 +21,7 @@ import AppPromptBar from '../src/components/common/AppPromptBar';
|
||||
import AppDialogHost from '../src/components/common/AppDialogHost';
|
||||
import { installAlertOverride } from '../src/services/alertOverride';
|
||||
import { useAuthStore } from '../src/stores';
|
||||
import { checkForAPKUpdate } from '../src/services/apkUpdateService';
|
||||
|
||||
registerNotificationPresentationHandler();
|
||||
|
||||
@@ -137,6 +138,26 @@ function NotificationBootstrap() {
|
||||
return null;
|
||||
}
|
||||
|
||||
function APKUpdateBootstrap() {
|
||||
const hasChecked = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasChecked.current) return;
|
||||
hasChecked.current = true;
|
||||
|
||||
// 延迟执行,避免与启动流程冲突
|
||||
const timer = setTimeout(() => {
|
||||
checkForAPKUpdate().catch((error) => {
|
||||
console.error('APK update check failed:', error);
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function ThemedStack() {
|
||||
const router = useRouter();
|
||||
const colors = useAppColors();
|
||||
@@ -148,6 +169,7 @@ function ThemedStack() {
|
||||
<SystemChrome />
|
||||
<SessionGate>
|
||||
<NotificationBootstrap />
|
||||
<APKUpdateBootstrap />
|
||||
<Stack screenOptions={{ headerShown: false }}>
|
||||
<Stack.Screen name="index" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="(auth)" options={{ headerShown: false }} />
|
||||
|
||||
Reference in New Issue
Block a user