0.4.2 • Published 9 months ago
rn-smart-permissions v0.4.2
rn-smart-permissions
Permissions Library for React Native ( Android and iOS). The NPM package is https://www.npmjs.com/package/rn-smart-permissions
Installation
npm install rn-smart-permissions
Advantages
Usage
import { checkAndRequestPermissions, PERMISSION, PERMISSION_RESULT} from 'rn-smart-permissions';
// ...
checkAndRequestPermissions(
PERMISSION.LOCATION,
() => {
//Rationale dialog here
return new Promise((resolve) => {
//show rationale dialog here and resolve the promise with true to continue
});
},
() => {
//blocked permission dialog here
return new Promise((resolve) => {
//show blocked permission dialog here and resolve the promise with true to open settings
});
}
)
.then((result) => {
if (result === PERMISSION_RESULT.AUTHORIZED) {
Alert.alert('', 'Got All access');
}
})
.catch((e) => {
console.log('permission', e);
});
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
Thanks
- https://www.npmjs.com/package/react-native-permissions
- https://www.npmjs.com/package/react-native-android-location-enabler
License
MIT
Made with create-react-native-library
0.4.1
10 months ago
0.4.0
10 months ago
0.4.2
9 months ago
0.3.8
1 year ago
0.3.7
1 year ago
0.3.6
1 year ago
0.3.5
1 year ago
0.3.4
2 years ago
0.3.3
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago
0.3.2
2 years ago
0.2.3
2 years ago
0.3.1
2 years ago
0.2.2
2 years ago
0.2.0
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago