YanmaY / react-native-permission

集成权限请求框架

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-permission

该插件尚未完成,权限项暂未实现通过参数动态申请

原生框架依赖 getActivity/XXPermissions

Getting started

$ npm install react-native-permission --save

Mostly automatic installation

$ react-native link react-native-permission

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.yanmay.permission.RNPermissionPackage; to the imports at the top of the file
  • Add new RNPermissionPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-permission'
    project(':react-native-permission').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-permission/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-permission')
    

Usage

import RNPermission from 'react-native-permission';

// TODO: What to do with the module?
RNPermission;

About

集成权限请求框架


Languages

Language:Java 96.6%Language:JavaScript 3.4%