Socket
Book a DemoInstallSign in
Socket

react-native-require-location

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-require-location

A react-native component for requiring location services in an application

0.0.8
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

React Native Location Services Requiring

a React Native module for requiring location services be enabled or turned on

Installation

  • npm install react-native-require-location --save
  • react-native link react-native-require-location

Usage

  import LocationServicesRequired from 'react-native-require-location';
  
  LocationServicesRequired.showSettings({
    message: "<h2>Use Location ?</h2>This app wants to change your device settings:<br/><br/>Use GPS, Wi-Fi, and cell network for location<br/><br/>",
    ok: "YES",
    cancel: "NO"
  }).then(success => {
    
    //can attempt to access location now
    
  }).catch(error => {
      
    //handle error
    
  }); 
  

Notes

the package will auto "close" (it will put the app to the background) the app hinting to the user that location is required to use the app

Keywords

react-component

FAQs

Package last updated on 08 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.