diff --git a/dev-client/package-lock.json b/dev-client/package-lock.json index 49b928f49..49a8ace33 100644 --- a/dev-client/package-lock.json +++ b/dev-client/package-lock.json @@ -30,6 +30,7 @@ "expo-dev-client": "~4.0.19", "expo-image-manipulator": "~12.0.5", "expo-image-picker": "~15.0.7", + "expo-location": "~17.0.1", "expo-media-library": "~16.0.4", "expo-screen-orientation": "~7.0.5", "expo-sensors": "~13.0.9", @@ -14512,6 +14513,14 @@ "invariant": "^2.2.4" } }, + "node_modules/expo-location": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/expo-location/-/expo-location-17.0.1.tgz", + "integrity": "sha512-m+OzotzlAXO3ZZ1uqW5GC25nXW868zN+ROyBA1V4VF6jGay1ZEs4URPglCVUDzZby2F5wt24cMzqDKw2IX6nRw==", + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-manifests": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.14.3.tgz", diff --git a/dev-client/package.json b/dev-client/package.json index aaeb1e47d..1cd351c16 100644 --- a/dev-client/package.json +++ b/dev-client/package.json @@ -39,6 +39,7 @@ "expo-dev-client": "~4.0.19", "expo-image-manipulator": "~12.0.5", "expo-image-picker": "~15.0.7", + "expo-location": "~17.0.1", "expo-media-library": "~16.0.4", "expo-screen-orientation": "~7.0.5", "expo-sensors": "~13.0.9", diff --git a/dev-client/src/App.tsx b/dev-client/src/App.tsx index b4d11b347..2adf23321 100644 --- a/dev-client/src/App.tsx +++ b/dev-client/src/App.tsx @@ -25,8 +25,7 @@ // react-native-get-random-values needed for uuid - https://github.com/uuidjs/uuid#react-native--expo import 'react-native-get-random-values'; -import {useEffect, useState} from 'react'; -import {LogBox, PermissionsAndroid} from 'react-native'; +import {LogBox} from 'react-native'; import {GestureHandlerRootView} from 'react-native-gesture-handler'; import {Provider} from 'react-redux'; @@ -37,6 +36,7 @@ import {NativeBaseProvider} from 'native-base'; import 'terraso-mobile-client/translations'; import 'terraso-mobile-client/config'; +import {useState} from 'react'; import {PaperProvider, Portal} from 'react-native-paper'; import {enableFreeze} from 'react-native-screens'; @@ -48,7 +48,6 @@ import {APP_CONFIG} from 'terraso-mobile-client/config'; import {GeospatialProvider} from 'terraso-mobile-client/context/GeospatialContext'; import {HeaderHeightContext} from 'terraso-mobile-client/context/HeaderHeightContext'; import {HomeScreenContextProvider} from 'terraso-mobile-client/context/HomeScreenContext'; -import {checkAndroidPermissions} from 'terraso-mobile-client/native/checkAndroidPermissions'; import {RootNavigator} from 'terraso-mobile-client/navigation/navigators/RootNavigator'; import {Toasts} from 'terraso-mobile-client/screens/Toasts'; import {createStore} from 'terraso-mobile-client/store'; @@ -75,12 +74,6 @@ LogBox.ignoreLogs([ const store = createStore(); function App(): React.JSX.Element { - useEffect(() => - checkAndroidPermissions( - PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, - ), - ); - const [headerHeight, setHeaderHeight] = useState(0); return ( diff --git a/dev-client/src/components/inputs/image/ImagePicker.tsx b/dev-client/src/components/inputs/image/ImagePicker.tsx index 7ae5e86d6..3c39f46d6 100644 --- a/dev-client/src/components/inputs/image/ImagePicker.tsx +++ b/dev-client/src/components/inputs/image/ImagePicker.tsx @@ -37,7 +37,7 @@ import { ModalHandle, ModalTrigger, } from 'terraso-mobile-client/components/modals/Modal'; -import {PermissionsRequestModal} from 'terraso-mobile-client/components/modals/PermissionsRequestModal'; +import {PermissionsRequestWrapper} from 'terraso-mobile-client/components/modals/PermissionsRequestWrapper'; import {Column} from 'terraso-mobile-client/components/NativeBaseAdapters'; import {OverlaySheet} from 'terraso-mobile-client/components/sheets/OverlaySheet'; @@ -100,10 +100,12 @@ export const ImagePicker = ({ return ( - {onRequestAction => ( )} - + )} diff --git a/dev-client/src/translations/en.json b/dev-client/src/translations/en.json index 5821c588d..701108606 100644 --- a/dev-client/src/translations/en.json +++ b/dev-client/src/translations/en.json @@ -451,7 +451,9 @@ "camera_title": "LandPKS Soil ID needs to access your camera", "camera_body": "To use {{feature}}, grant LandPKS Soil ID access to your camera in device settings.", "gallery_title": "LandPKS Soil ID needs to access your photo gallery", - "gallery_body": "To use {{feature}}, grant LandPKS Soil ID access to your photo gallery in device settings." + "gallery_body": "To use {{feature}}, grant LandPKS Soil ID access to your photo gallery in device settings.", + "location_title": "LandPKS Soil ID needs to access your location", + "location_body": "For the best map experience, grant LandPKS Soil ID access to your location in device settings." }, "errors": { "generic": "Error saving soil ID information."