// var arr = ['android.permission.ACCESS_LOCATION_EXTRA_COMMANDS, android.permission.CAMERA , android.permission.READ_CALENDAR , android.permission.BIND_DEVICE_ADMIN , android.permission.READ_EXTERNAL_STORAGE']
var arr = ['android.permission.ACCESS_LOCATION_EXTRA_COMMANDS']
plus.android.requestPermissions( arr, function(e){
console.log(88)
console.log(JSON.stringify(e))
if(e.deniedAlways.length>0){ //权限被永久拒绝
// 弹出提示框解释为何需要权限,引导用户打开设置页面开启
console.log('权限被永久拒绝'+e.deniedAlways.toString());
}
if(e.deniedPresent.length>0){ //权限被临时拒绝
// 弹出提示框解释为何需要权限,可再次调用plus.android.requestPermissions申请权限
console.log('权限被临时拒绝'+e.deniedPresent.toString());
}
if(e.granted.length>0){ //权限被允许
$('#positionInfo span').html('已开启 ')
console.log('权限被允许'+e.granted.toString());
}
}, function(e){
console.log('Request Permissions error:'+JSON.stringify(e));
}); ```javascript
0 个回复