<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>navigator Example</title>
<script src='js/mui.min.js'></script>
<link rel="stylesheet" href="css/mui.min.css" />
<script type="text/javascript">
</script>
<style>
*{
text-align:center;
}
</style>
</head>
<body>
<br /><br />
<h2>检查权限 </h2><br />
<button id='a1'>检查相机权限</button> <br /><br />
<button id='a2'>检查系统联系人权限</button> <br /><br />
<button id='a3'>检查相册权限</button> <br /><br/>
<button id='a4'>检查定位权限</button> <br /><br />
<button id='a5'>检查推送通知权限</button> <br /><br />
<button id='a6'>检查录音权限</button> <br /><br />
<button id='a7'>检查快捷方式权限</button>
<script>
mui.plusReady(function(){
// CAMERA 检查相机权限
document.getElementById("a1").addEventListener("tap",function(){
CAMERA_P=plus.navigator.checkPermission("CAMERA");
plus.nativeUI.alert("CAMERA:"+CAMERA_P);
})
// CONTACTS 检查系统联系人权限
document.getElementById("a2").addEventListener("tap",function(){
CONTACTS_P=plus.navigator.checkPermission("CONTACTS");
plus.nativeUI.alert("CONTACTS:"+CONTACTS_P);
})
// GALLERY 检查相册权限
document.getElementById("a3").addEventListener("tap",function(){
GALLERY_P=plus.navigator.checkPermission("GALLERY");
plus.nativeUI.alert("GALLERY:"+GALLERY_P);
})
// LOCATION 检查定位权限
document.getElementById("a4").addEventListener("tap",function(){
LOCATION_P=plus.navigator.checkPermission("LOCATION");
plus.nativeUI.alert("LOCATION:"+LOCATION_P);
})
// NOTIFITION 检查推送通知权限
document.getElementById("a5").addEventListener("tap",function(){
NOTIFITION_P=plus.navigator.checkPermission("NOTIFITION");
plus.nativeUI.alert("NOTIFITION:"+NOTIFITION_P);
})
// RECORD 检查录音权限
document.getElementById("a6").addEventListener("tap",function(){
RECORD_P=plus.navigator.checkPermission("RECORD");
plus.nativeUI.alert("RECORD:"+RECORD_P);
})
// SHORTCUT 检查快捷方式权限
document.getElementById("a7").addEventListener("tap",function(){
SHORTCUT_P=plus.navigator.checkPermission("SHORTCUT");
plus.nativeUI.alert("SHORTCUT:"+SHORTCUT_P);
})
});
</script>
</body>
</html>
2***@qq.com
- 发布:2016-08-11 16:40
- 更新:2017-05-19 11:56
- 阅读:3231
滴滴哒
那Android机型获取录音之类的权限,应该怎么处理?
2016-11-24 16:36