react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

No pop-up asking for permission on testflight

Open shunki-github opened this issue 4 years ago • 0 comments

environment

react-native-web

Platforms

iOS

Versions

  • Android:
  • iOS: 14.7.1
  • react-native-geolocation: 2.0.2
  • react-native: ?
  • react: 16.14.0

Description

I've installed this library in my iOS app, but I don't get the popup asking for permission. I have uninstalled the app once but still no popup.

Please let me know the cause and solution. Note that requestAuthorization() will not work.

index.js

class Geoprivate extends Component {
	constructor() {
		super()
		this.state = {
			latitude: "",
			longitude: "",
			errMessage: ""
		}
	}

,,,
,,,
,,,

	componentDidMount() {
		this.updateResult()
	  }

	updateResult() {
		
		if (Platform.OS === "android") {
			this.androidPermission()
		}

		let is_native = typeof document === 'undefined';		
		if (!is_native) {
			if( !navigator.geolocation ){
				this.setState({ errMessage: "navigator.geolocation is not found."})
			} else {
				navigator.geolocation.getCurrentPosition( 
					//position => this.extract(position), error => this.giveError(error));
					position => this.extract(position), error => this.setState({ errMessage: error })
					);
			}
		} else if (is_native) {
			Geolocation.getCurrentPosition(
				position => this.setState({ latitude: position.coords.latitude, longitude: position.coords.longitude }),
				err => this.setState({ errMessage: err.message }),
				{ enableHighAccuracy: true, timeout: 10000, maximumAge: 10000 }
			);
		}
		this.returnResult()
	}

shunki-github avatar Sep 13 '21 06:09 shunki-github