diff --git a/App.tsx b/App.tsx index 6a72d9f..40b19f2 100644 --- a/App.tsx +++ b/App.tsx @@ -68,11 +68,18 @@ export default function App() { useEffect(() => { (async () => { await SplashScreen.preventAutoHideAsync(); - const [isPlantServiceUp, cameraPer, pickerPer] = await Promise.all([ - isServiceAvailable(), + const [cameraPer, pickerPer] = await Promise.all([ Camera.requestPermissionsAsync(), ImagePicker.requestMediaLibraryPermissionsAsync(), ]); + setHasPermissionCamera(cameraPer.status === "granted"); + setHasPermissionPicker(pickerPer.status === "granted"); + setAppIsReady(true); + await analytics().logEvent("app_open", { + time: Date.now(), + }); + // Calling the service last to make sure it's not blocking app startup due to Heroku server sleep + const isPlantServiceUp = await isServiceAvailable(); if (!isPlantServiceUp) { Alert.alert( "Oh! Snap", @@ -80,13 +87,7 @@ export default function App() { [{ text: "Close App", onPress: () => BackHandler.exitApp() }] ); } - setHasPermissionCamera(cameraPer.status === "granted"); - setHasPermissionPicker(pickerPer.status === "granted"); - setAppIsReady(true); setRecognized(isPlantServiceUp.recognized); - await analytics().logEvent("app_open", { - time: Date.now(), - }); })(); }, []); diff --git a/android/app/build.gradle b/android/app/build.gradle index a044984..9bb1c99 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -136,8 +136,8 @@ android { applicationId "com.plantrecog" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 10 - versionName "0.8.0" + versionCode 11 + versionName "0.9.0" } splits { abi { diff --git a/app.json b/app.json index af68360..16380f3 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "PlantRecog", "slug": "PlantRecog", - "version": "0.8.0", + "version": "0.9.0", "assetBundlePatterns": [ "**/*" ]