Ver código fonte

removed background location request and popup

Viktoriia 2 dias atrás
pai
commit
c46f56bcd2

+ 18 - 16
src/screens/InAppScreens/MapScreen/FilterModal/index.tsx

@@ -532,13 +532,13 @@ const FilterModal = ({
     if (status === 'granted' && isServicesEnabled) {
       const bgStatus = await Location.getBackgroundPermissionsAsync();
       if (bgStatus.status !== 'granted') {
-        const { status } = await requestBackgroundPermissionSafe();
-        if (status === Location.PermissionStatus.GRANTED) {
-          await startBackgroundLocationUpdates();
-        } else {
-          await stopBackgroundLocationUpdates();
-          setOpenSettingsBackgroundVisible(true);
-        }
+        // const { status } = await requestBackgroundPermissionSafe();
+        // if (status === Location.PermissionStatus.GRANTED) {
+        //   await startBackgroundLocationUpdates();
+        // } else {
+        await stopBackgroundLocationUpdates();
+        // setOpenSettingsBackgroundVisible(true);
+        // }
       } else {
         await startBackgroundLocationUpdates();
       }
@@ -580,13 +580,13 @@ const FilterModal = ({
       const bgStatus = await Location.getBackgroundPermissionsAsync();
 
       if (bgStatus.status !== 'granted') {
-        const { status } = await requestBackgroundPermissionSafe();
-        if (status === Location.PermissionStatus.GRANTED) {
-          await startBackgroundLocationUpdates();
-        } else {
-          await stopBackgroundLocationUpdates();
-          setOpenSettingsBackgroundVisible(true);
-        }
+        // const { status } = await requestBackgroundPermissionSafe();
+        // if (status === Location.PermissionStatus.GRANTED) {
+        //   await startBackgroundLocationUpdates();
+        // } else {
+        await stopBackgroundLocationUpdates();
+        // setOpenSettingsBackgroundVisible(true);
+        // }
       } else {
         await startBackgroundLocationUpdates();
       }
@@ -730,7 +730,9 @@ const FilterModal = ({
           </View>
         </TouchableOpacity>
 
-        <View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 12 }}>
+        <View style={styles.divider} />
+
+        {/* <View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 12 }}>
           <View style={styles.divider} />
           <Text
             style={{
@@ -743,7 +745,7 @@ const FilterModal = ({
             Premium Features
           </Text>
           <View style={styles.divider} />
-        </View>
+        </View> */}
 
         {/* <TouchableOpacity
           style={[

+ 2 - 1
src/screens/InAppScreens/MapScreen/FilterModal/styles.tsx

@@ -134,7 +134,8 @@ export const styles = StyleSheet.create({
   },
   divider: {
     height: 1,
-    flex: 1,
+    width: '100%',
+    marginVertical: 12,
     backgroundColor: Colors.DARK_LIGHT
   }
 });

+ 10 - 10
src/screens/InAppScreens/MapScreen/index.tsx

@@ -809,12 +809,12 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
 
       const bgStatus = await Location.getBackgroundPermissionsAsync();
       if (bgStatus.status !== 'granted') {
-        const { status } = await requestBackgroundPermissionSafe();
-        if (status === Location.PermissionStatus.GRANTED) {
-          await startBackgroundLocationUpdates();
-        } else {
+        // const { status } = await requestBackgroundPermissionSafe();
+        // if (status === Location.PermissionStatus.GRANTED) {
+        //   await startBackgroundLocationUpdates();
+        // } else {
           await stopBackgroundLocationUpdates();
-        }
+        // }
       } else {
         // await startBackgroundLocationUpdates();
         await restartBackgroundLocationUpdates();
@@ -1097,12 +1097,12 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
       if (status === 'granted' && isServicesEnabled) {
         const bgStatus = await Location.getBackgroundPermissionsAsync();
         if (bgStatus.status !== 'granted') {
-          const { status } = await requestBackgroundPermissionSafe();
-          if (status === Location.PermissionStatus.GRANTED) {
-            await startBackgroundLocationUpdates();
-          } else {
+          // const { status } = await requestBackgroundPermissionSafe();
+          // if (status === Location.PermissionStatus.GRANTED) {
+          //   await startBackgroundLocationUpdates();
+          // } else {
             await stopBackgroundLocationUpdates();
-          }
+          // }
         } else {
           await startBackgroundLocationUpdates();
         }

+ 12 - 12
src/screens/LocationSharingScreen/index.tsx

@@ -164,13 +164,13 @@ const LocationSharingScreen = ({ navigation }: { navigation: any }) => {
       getLocationToggle(isSettings);
       const bgStatus = await Location.getBackgroundPermissionsAsync();
       if (bgStatus.status !== 'granted') {
-        const { status } = await requestBackgroundPermissionSafe();
-        if (status === Location.PermissionStatus.GRANTED) {
-          await startBackgroundLocationUpdates();
-        } else {
+        // const { status } = await requestBackgroundPermissionSafe();
+        // if (status === Location.PermissionStatus.GRANTED) {
+        //   await startBackgroundLocationUpdates();
+        // } else {
           await stopBackgroundLocationUpdates();
-          setOpenSettingsBackgroundVisible(true);
-        }
+          // setOpenSettingsBackgroundVisible(true);
+        // }
       } else {
         await startBackgroundLocationUpdates();
       }
@@ -225,13 +225,13 @@ const LocationSharingScreen = ({ navigation }: { navigation: any }) => {
       getLocation();
       const bgStatus = await Location.getBackgroundPermissionsAsync();
       if (bgStatus.status !== 'granted') {
-        const { status } = await requestBackgroundPermissionSafe();
-        if (status === Location.PermissionStatus.GRANTED) {
-          await startBackgroundLocationUpdates();
-        } else {
+        // const { status } = await requestBackgroundPermissionSafe();
+        // if (status === Location.PermissionStatus.GRANTED) {
+        //   await startBackgroundLocationUpdates();
+        // } else {
           await stopBackgroundLocationUpdates();
-          setOpenSettingsBackgroundVisible(true);
-        }
+          // setOpenSettingsBackgroundVisible(true);
+        // }
       } else {
         await startBackgroundLocationUpdates();
       }