Posts

Showing posts with the label geolocation

React-native Geolocation

I'm new to react. And I'm expecting to build a mobile Application from Web-App using Cordova plug-in. So in this case I want to get the App location. I'm trying this with react-native Geolocation . I followed the tutorial from facebook at here. But when I tried it, It does not show me the position. Instead value of the position change from unknown to {} . There might be few errors I'm doing here. I'm using a proxy Testing this in browser not in Android or any other native device. Facebook Link says it is react-native but my project was created by create-react-app which I think not React-native If any of these is not the cause for this error, Please help. My code, import React,{Component} from 'react'; class GeoLocation extends React.Component { state = { initialPosition: 'unknown', lastPosition: 'unknown', }; watchID: ?number = null; componentDidMount() { if (navigator.geolocation) { n...