Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-authorization BuildPlatformnpm

Request user permissions from React Native, iOS + Android

  • iOS: need add authorization’s key in info.plist
  • android: need add permission in AndroidManifest.xml

Content

# step 1
npm install react-native-authorization 
# yarn add react-native-authorization

# step 2
react-native link react-native-authorization 
import Helper from 'react-native-authorization'

Helper.check(Helper.CAMERA).then((r)=>{
    console.log(r);
});

Methods

Method Name Arguments Notes iOS android
check type Returns a promise ✔️ ✔️
multipleCheck [type1,type2] Returns a promise ❌ ✔️

Check Type

Name iOS android
CAMERA ✔️ ✔️
LIBRARY ✔️ ❌
LOCATION ✔️ ✔️
ALWAYSLOCATION ✔️ ❌
USELOCATION ✔️ ❌
MIKE ✔️ ❌
CALENDAR ❌ ✔️
CONTACTS ❌ ✔️
MICROPHONE ❌ ✔️
PHONE ❌ ✔️
SENSORS ❌ ✔️
SMS ❌ ✔️
STORAGE ❌ ✔️

Permission Result

Result Type iOS android
Authorized string ✔️ ❌
AuthorizedAlways string ✔️ ❌
AuthorizedWhenInUse string ✔️ ❌
Denied string ✔️ ❌
NotDetermined string ✔️ ❌
Restricted string ✔️ ❌
true boolean ❌ ✔️
false boolean ❌ ✔️

Ruwei Li, liruwei0109@outlook.com

react-native-authorization is available under the ISC license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages