Closed prajna-h closed 2 years ago
Failing to get the location and gives null is not an object.
Environment react-native-cli: 2.0.1 react-native: 0.62.2
react-native-geolocation-service: ^5.0.0
buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "27.1.1" googlePlayServicesAuthVersion = "17.0.0"
Android version - 10
requestLocationPermission = async () => { let granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, { title: "App Geolocation Permission", message: "App needs access to your phone's location.", } ); if (granted === PermissionsAndroid.RESULTS.GRANTED) { Geolocation.getCurrentPosition((position) => { console.log(position); }, (error) => { console.log(error.code, error.message); }, { enableHighAccuracy: false, timeout: 15000, maximumAge: 10000 } ); } else { console.log('Location permission not granted!!!!'); } }; componentDidMount() { this.requestLocationPermission(); }
Sorry for the delay, this is most probably an issue with your setup. Please check if this library is integrated properly.
Closing due to inactivity
Failing to get the location and gives null is not an object.
Environment react-native-cli: 2.0.1 react-native: 0.62.2
react-native-geolocation-service: ^5.0.0
buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "27.1.1" googlePlayServicesAuthVersion = "17.0.0"
Android version - 10