应用商店审核要求 获取权限前需要给提示,拒绝之后48小时不能给弹窗授权
项目用的是uniapp
getImagePermission(v?: string, tag?: any, source?: any, proj?: any) {
// proj = proj || vueSelf.$proj(tag, source);
let data = {
state: false,//是否原生授权
denied: true,//是否提示
permissionList: [
{
permissionName: "相机",
tips: "允许应用打开摄像头",
androidPermission: "android.permission.CAMERA",
},
{
permissionName: "相册",
tips: "允许应用读取存储卡上的照片、媒体内容和文件",
androidPermission: "android.permission.READ_EXTERNAL_STORAGE",
},
],
};
userPermissions(
JSON.stringify(data), null, null, null,
function (res) {
console.log("getImagePermission res", res);
// console.log("getImagePermission back", back);
// back(res === 1 ? true : false)
vueSelf.$callback('abAct.getImagePermission', null, res == 1 ? true : false);
}
);
// 这里是因为异步问题,必须写这个
return true
},
_androidPermissions: <any>undefined,
userPermissions(v?: string, back?: any) {
proj = proj || vueSelf.$proj(tag, source);
// #ifdef APP
try {
if (axCc.info.platform == "android") {
let permissionDs: any[] = JSON.parse(v);
let permissionState = false;
let permissionDenied = ""