我正在使用PermissionsAndroid向用户请求权限。我已经使用了那里给出的示例代码。
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.CAMERA,
{
'title': 'Cool Photo App Camera Permission',
'message': 'Cool Photo App needs access to your camera ' +
'so you can take awesome pictures.'
}
)
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log("You can use the camera")
} else {
console.log("Camera permission denied")
}
} catch (err) {
console.warn(err)
}
每当我调用此方法时,它总是显示输出为" 您可以使用相机"。但是,我已从应用设置中禁用了该权限,但仍然始终将该权限显示为GRANTED
答案 0 :(得分:0)
请确保以下条目位于AndroidManifest.xml
中<meta property="og:title" content="4 Ways to Strengthen Weak Body Parts" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://www.labrada.com/articles/wp-content/themes/article/images/labradalogo.png" />
<meta property="og:image:height" content="450" />
<meta property="og:image:width" content="397" />
<meta property="og:url" content="http://www.labrada.com/articles/" />
<meta property="og:description" content="It can be a bit degrading when everything except for a few muscles grow consistently and imbalances if your overall shape start to become apparent. One of the most frustrating things is when you put y" />
<meta property="og:site_name" content="Labrada" />
我在Xamarin Native中遇到同样的问题,只是在build.gradle中设置属性是不够的
答案 1 :(得分:0)
你应该在官方文档中使用min targetSdkVersion作为23。
Permission Android Official Docs
在SDK版本23之前的设备上,如果权限出现在清单中,则会自动授予权限,因此检查和请求应始终为true。