https://github.com/shashank2406/react-native-google-location-fetcher
Google Location Fetcher
https://github.com/shashank2406/react-native-google-location-fetcher
google-api location react-native
Last synced: 10 days ago
JSON representation
Google Location Fetcher
- Host: GitHub
- URL: https://github.com/shashank2406/react-native-google-location-fetcher
- Owner: Shashank2406
- Created: 2018-07-14T20:04:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-15T14:03:28.000Z (over 7 years ago)
- Last Synced: 2025-07-01T13:55:27.985Z (4 months ago)
- Topics: google-api, location, react-native
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-google-location-fetcher
Google Location Fetcher for iOS and Android React-Native apps
## PLANNED FEATURES
- [x] Get Location Coordinates
- [x] Reverse Geocoding from Google API
- [x] Get Location Name from Google API
- [x] Get any Location Coordinates from Google API
- [ ] Ask permission for location on Android
### Installation
1. ```npm install react-native-google-location-fetcher --save```
2. Get your [Google Places API keys](https://developers.google.com/places/) and enable "Google Places API Web Service" (NOT Android or iOS) in the console.
3. Enable "Google Maps Geocoding API" if you want to use GoogleReverseGeocoding for Current Location
For Android: add the following line in your AndroidManifest.xml
```xml
```
### Example
```jsx
import React from 'react';
import { View, Image } from 'react-native';
import {GoogleLocationFetcher} from 'react-native-google-location-fetcher'
export default class App extends Component {
componentWillMount(){
// To initialise the module
GoogleLocationFetcher.initialise(YOUR_API_KEY)
// To get current Location coordinates and name
console.log(GoogleLocationFetcher.getCurrentLocation())
// To get location name from coordinates
console.log(GoogleLocationFetcher.getLocationName(LATITUDE,LONGITUDE))
// TO get location coordinates
console.log(GoogleLocationFetcher.getLocationCoordinates(ANY_LOCATION_NAME))
}
render() {
return (
Welcome to React Native!
To get started, edit App.js
{instructions}
);
}
}
```