0.3.8 • Published 4 months ago

rn-smart-permissions v0.3.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

  1. https://www.npmjs.com/package/react-native-permissions
  2. https://www.npmjs.com/package/react-native-android-location-enabler

License

MIT


Made with create-react-native-library

0.3.8

4 months ago

0.3.7

4 months ago

0.3.6

4 months ago

0.3.5

4 months ago

0.3.4

7 months ago

0.3.3

12 months ago

0.3.0

1 year ago

0.2.1

1 year ago

0.3.2

1 year ago

0.2.3

1 year ago

0.3.1

1 year ago

0.2.2

1 year ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago