1.0.9 • Published 3 years ago

react-native-get-address v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Get current address in react native

This library is to get current location address by providing google API key. This is under maintenance. So please use it with your own risk

Before use, get google API Key and enable Geocoading API.

Install

npm i react-native-get-address

Link with react-native link

If you are using React Native <= 0.59.X, link the native project:

react-native link react-native-get-address

Android post install

For Android API < 23 you need to define the location permissions on AndroidManifest.xml.

<!-- Define ACCESS_FINE_LOCATION if you will use enableHighAccuracy=true  -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<!-- Define ACCESS_COARSE_LOCATION if you will use enableHighAccuracy=false  -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

iOS post install

You need to define the permission NSLocationWhenInUseUsageDescription on Info.plist.

<key>NSLocationWhenInUseUsageDescription</key>
<string>Provide you valid reason of use...</string>

Usage:

import GetAddress from 'react-native-get-address';


const getAddress = async () => {
    const currentAddress = await GetAddress('<Your google API Key>');
    console.log("currentAddress: ", currentAddress);
}