0.0.5 • Published 1 year ago

uclean-permission-plugin v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

uclean-permission-plugin

插件安装与卸载

卸载插件

npm uninstall uclean-permission-plugin

安装插件

npm install uclean-permission-plugin

在android/app/src/main/java/com/ujing/franchisee/MainActivity.java 的init方法中增加 add( UcleanPermissionPlugin.class );

this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
  // Additional plugins you've installed go here
  // Ex: add(TotallyAwesomePlugin.class);
  add( UcleanPermissionPlugin.class );
}});

js调用方法

检查权限是否打开

const { UcleanPermissionPlugin } = Capacitor.Plugins;
const result = await UcleanPermissionPlugin.checkSelfPermissions({
  permissions: [String]
});
参数
{
   /**权限数组 ******
   bluetoothle,  //蓝牙权限
   bluetoothleOpen, //蓝牙开关
   camera,  //相机权限
   location, //定位权限
   locationService, //位置服务
   storage  //存储权限
   ************/
  permissions: [string] 
}
返回值格式
{
   errorCode: String,
   errorMessage: string,
   data: [object]
}

data格式:
[{"bluetoothle": false}, {"bluetoothleOpen": false}]

bluetoothle, //蓝牙权限是否打开
bluetoothleOpen, //蓝牙开关是否打开
camera,//相机权限是否打开
location,//位置权限是否打开
locationService,//位置服务是否打开
storage //存储权限是否打开

其他方法以及object具体参数,参考文档:https://ujing.yuque.com/sw_dev/native/wr4g13

0.0.5

1 year ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago