Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29601

Add geolocation to Create React Native App

$
0
0

I have created my first React Native app using the latest Expo CLI using instructions from React Native docs:

npm install -g expo-cli
npm expo init AwesomeProject

Later I wanted to add the geolocation library to this app and it seems that the whole autolinking doesn't want to work for me. I have used the provided instructions:

yarn add @react-native-community/geolocation

And I haven't done the manual linking because I am using React Native in the currently newest version (above 0.59 as said in the readme of the library). After adding the sample code:

import Geolocation from '@react-native-community/geolocation';
Geolocation.getCurrentPosition(info => console.log(info));

I have started to get errors that the library should be linked. After manually invoking the link command it still unfortunately hasn't worked.


Viewing all articles
Browse latest Browse all 29601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>