Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@tuup/react-native-gps-state
Advanced tools
This lib will emitevent wheneaver the GPS status change, like when the permission was rejected or user disable Location service in system Settings.
yarn add react-native-gps-state
npm install --save react-native-gps-state
react-native link react-native-gps-state
Platform | Status Code | Constant | Description |
---|---|---|---|
IOS/Android | 0 | NOT_DETERMINED | The user has not yet made a choice regarding whether this app can use location services. |
IOS/Android | 1 | RESTRICTED | This app is not authorized to use location services. |
IOS/Android | 2 | DENIED | The user explicitly denied the use of location services for this app or location services are currently disabled in Settings. |
IOS/Android | 3 | AUTHORIZED | This app is authorized to use location services. |
IOS | 3 | AUTHORIZED_ALWAYS | This app is authorized to start location services at any time. |
IOS | 4 | AUTHORIZED_WHENINUSE | This app is authorized to start most location services while running in the foreground |
//Open the system Settings to enable user to toggle Location on
GPSState.openSettings();
//Get the current GPS state
GPSState.getStatus().then((status)=>{
});
import GPSState from 'react-native-gps-state';
...
componentWillMount(){
GPSState.addListener((status)=>{
switch(status){
case GPSState.NOT_DETERMINED:
alert('Please, allow the location, for us to do amazing things for you!');
break;
case GPSState.RESTRICTED:
GPSState.openSettings();
break;
case GPSState.DENIED:
alert('It`s a shame that you do not allowed us to use location :(');
break;
case GPSState.AUTHORIZED_ALWAYS:
//TODO do something amazing with you app
break;
case GPSState.AUTHORIZED_WHENINUSE:
//TODO do something amazing with you app
break;
}
});
}
componentWillUnmount(){
GPSState.removeListener();
}
FAQs
React Native Listener for GPS status changes
The npm package @tuup/react-native-gps-state receives a total of 2 weekly downloads. As such, @tuup/react-native-gps-state popularity was classified as not popular.
We found that @tuup/react-native-gps-state demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.