From 560774497b9c327705f276e1e442db67da228bc2 Mon Sep 17 00:00:00 2001 From: Zaka Khan Date: Mon, 24 Oct 2022 19:04:37 +0500 Subject: [PATCH] Updated the Geolocation import in MapViewNavigation/index.js file for latest versions of RN versions greater than 0.60 --- src/components/MapViewNavigation/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/MapViewNavigation/index.js b/src/components/MapViewNavigation/index.js index 092a213a..ef3c3ebd 100644 --- a/src/components/MapViewNavigation/index.js +++ b/src/components/MapViewNavigation/index.js @@ -4,7 +4,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import {CoordinatePropType} from '../../constants/PropTypes'; -import { View, TouchableOpacity, Text, Dimensions, Geolocation } from 'react-native'; +import Geolocation from '@react-native-community/geolocation'; +import { View, TouchableOpacity, Text, Dimensions } from 'react-native'; import connectTheme from '../../themes'; import Geocoder from '../../modules/Geocoder'; import Directions from '../../modules/Directions'; @@ -128,7 +129,7 @@ export default class MapViewNavigation extends Component { */ componentDidMount() { - this.watchId = navigator.geolocation.watchPosition(position => { + this.watchId = Geolocation.watchPosition(position => { this.setPosition(position.coords); @@ -140,7 +141,7 @@ export default class MapViewNavigation extends Component { */ componentWillUnmount() { - navigator.geolocation.clearWatch(this.watchId); + Geolocation.clearWatch(this.watchId); } /**