Created
November 28, 2018 15:04
-
-
Save jarakys/1f96ef847faff9ee75dcef9e731a16b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _onFindCoordinates() { | |
| try { | |
| const granted = PermissionsAndroid.request( | |
| PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, | |
| { | |
| 'title': 'Location', | |
| 'message': 'test app access to your location' | |
| } | |
| ); | |
| if (granted === PermissionsAndroid.RESULTS.GRANTED) { | |
| Alert.alert('Now me can find you, and KIII') | |
| } else { | |
| Alert.alert('Это просто конец') | |
| } | |
| } catch (err) { | |
| Alert.alert('ЕГГОР') | |
| } | |
| navigator.geolocation.getCurrentPosition( | |
| position => { | |
| const location = JSON.stringify(position); | |
| this.setState({ stringCoordinate:location }); | |
| }, | |
| error => Alert.alert(error.message), | |
| { enableHighAccuracy: false, timeout: 20000, maximumAge: 1000 } | |
| ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment