react-native-location-satellites

Getting started
$ npm install react-native-location-satellites --save
NOTE: Due to security issues iOS will not disclose satellite counts.
iOS library will give you location details except satellite count
Mostly automatic installation
$ react-native link react-native-location-satellites
Manual installation
Android
- Append the following lines to
android/settings.gradle
:include ':react-native-location-satellites' project(':react-native-location-satellites').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-location-satellites/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-location-satellites')
- Append the following lines in
MainApplication.java
import com.synclovis.RNLocationSatellitesPackage; protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new RNLocationSatellitesPackage() ); }
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-location-satellites
and addRNLocationSatellites.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNLocationSatellites.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Using Cocoapods
- In Terminal, from your root folder,
cd iOS
- Open PodFile, add the following,
pod 'react-native-location-satellites', :path => '../node_modules/react-native-location-satellites'
- Run
pod install
Usage
Make sure that you have accessed right permissions for getting location.
This library will give you the following location details,
- latitude & longitude
- accuracy
- speed
- altitude
- bearing
- satellites
;;const GPSEventEmitter = RNLocationSatellites{ /** * iOS Only - Request location permission (iOS 13 Support) */ RNLocationSatellites /** * Event for getting location. */ GPSEventEmitter /** * Starts location update */ RNLocationSatellites /** * Android Only - Returns the last known location (GPS) */ RNLocationSatellites} { GPSEventEmitter }