From 2fad63c28d335ed5f8d3c0ff6f046fc4449f91f9 Mon Sep 17 00:00:00 2001 From: Xor290 Date: Sun, 1 Mar 2026 17:12:01 +0100 Subject: [PATCH] chore: fix updates --- mobile/App.tsx | 20 ++++++++- mobile/app.json | 116 ++++++++++++++++++++++++++---------------------- mobile/eas.json | 10 +++-- 3 files changed, 87 insertions(+), 59 deletions(-) diff --git a/mobile/App.tsx b/mobile/App.tsx index 69721f58..a6bcfd2b 100644 --- a/mobile/App.tsx +++ b/mobile/App.tsx @@ -1,8 +1,9 @@ -import React from "react"; +import React, { useEffect } from "react"; import { StatusBar } from "expo-status-bar"; import { ActivityIndicator, View } from "react-native"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; +import * as Updates from "expo-updates"; import { AuthProvider, useAuth } from "./src/auth/AuthContext"; import { CartProvider } from "./src/context/CartContext"; @@ -99,6 +100,23 @@ function RootNavigator() { function AppContent() { const { isDark } = useTheme(); + + useEffect(() => { + if (__DEV__) return; + const checkForUpdate = async () => { + try { + const update = await Updates.checkForUpdateAsync(); + if (update.isAvailable) { + await Updates.fetchUpdateAsync(); + await Updates.reloadAsync(); + } + } catch { + // Silently ignore update errors + } + }; + checkForUpdate(); + }, []); + return ( diff --git a/mobile/app.json b/mobile/app.json index 6310e5c1..bed593f7 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -1,57 +1,65 @@ { - "expo": { - "name": "Uber Stup", - "slug": "frontend-client", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/icon.png", - "userInterfaceStyle": "dark", - "newArchEnabled": true, - "splash": { - "image": "./assets/icon.png", - "resizeMode": "contain", - "backgroundColor": "#000000" - }, - "ios": { - "supportsTablet": true, - "bundleIdentifier": "com.uberstup.clientpanel" - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/icon.png", - "backgroundColor": "#000000" - }, - "edgeToEdgeEnabled": true, - "predictiveBackGestureEnabled": false, - "package": "com.uberstup.clientpanel", - "versionCode": 1, - "permissions": [ - "android.permission.RECEIVE_BOOT_COMPLETED", - "android.permission.VIBRATE" - ] - }, - "web": { - "favicon": "./assets/icon.png" - }, - "plugins": [ - "expo-font", - "expo-router", - [ - "expo-notifications", - { - "icon": "./assets/icon.png", - "color": "#000000", - "defaultChannel": "orders", - "sounds": [] - } - ] - ], - "extra": { - "eas": { - "projectId": "110d06c8-a8d5-4b3c-b262-0d4d7509ae9d" - }, - "router": {} - }, - "owner": "xor290" + "expo": { + "name": "Uber Stup", + "slug": "frontend-client", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/icon.png", + "userInterfaceStyle": "dark", + "newArchEnabled": true, + "splash": { + "image": "./assets/icon.png", + "resizeMode": "contain", + "backgroundColor": "#000000" + }, + "ios": { + "supportsTablet": true, + "bundleIdentifier": "com.uberstup.clientpanel" + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/icon.png", + "backgroundColor": "#000000" + }, + "edgeToEdgeEnabled": true, + "predictiveBackGestureEnabled": false, + "package": "com.uberstup.clientpanel", + "versionCode": 1, + "permissions": [ + "android.permission.RECEIVE_BOOT_COMPLETED", + "android.permission.VIBRATE", + "android.permission.RECEIVE_BOOT_COMPLETED", + "android.permission.VIBRATE" + ] + }, + "web": { + "favicon": "./assets/icon.png" + }, + "plugins": [ + "expo-font", + "expo-router", + [ + "expo-notifications", + { + "icon": "./assets/icon.png", + "color": "#000000", + "defaultChannel": "orders", + "sounds": [] + } + ] + ], + "extra": { + "eas": { + "projectId": "110d06c8-a8d5-4b3c-b262-0d4d7509ae9d" + }, + "router": {} + }, + "owner": "xor290", + "runtimeVersion": { + "policy": "appVersion" + }, + "updates": { + "url": "https://u.expo.dev/110d06c8-a8d5-4b3c-b262-0d4d7509ae9d" } + } } diff --git a/mobile/eas.json b/mobile/eas.json index a9a73f9a..86bb7597 100644 --- a/mobile/eas.json +++ b/mobile/eas.json @@ -16,7 +16,8 @@ }, "env": { "API_URL": "https://uber-stup.club" - } + }, + "channel": "development" }, "preview": { "distribution": "internal", @@ -25,18 +26,19 @@ }, "env": { "API_URL": "https://uber-stup.club" - } + }, + "channel": "preview" }, "production": { "distribution": "internal", "autoIncrement": true, - "channel": "production", "android": { "buildType": "apk" }, "env": { "API_URL": "https://uber-stup.club" - } + }, + "channel": "production" } } }