Android Expo权限返回状态为';待定';
在我的react native应用程序中,我请求获得访问相机卷的权限,如下所示:Android Expo权限返回状态为';待定';,android,react-native,permissions,expo,Android,React Native,Permissions,Expo,在我的react native应用程序中,我请求获得访问相机卷的权限,如下所示: getPermissionAsync = async () => { const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL); if (status !== "granted") { alert("Sorry, we need camera roll permissions to make t
getPermissionAsync = async () => {
const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
if (status !== "granted") {
alert("Sorry, we need camera roll permissions to make this work!");
}
await this.setState({ permission: status === "granted" });
};
_pickMedia = async (index, type) => {
if (this.state.permission != true) {
await this.getPermissionAsync();
}
if (this.state.permission == true) {
// get image
} catch (E) {
console.log(E);
}
}
};
在测试过程中,这与预期的一样有效,但是对于我在Google Play上发布的版本,无论用户是否给予许可,状态都返回为
未确定。这意味着什么?升级react本机-community@react-2.0.0的本机权限解决了这个问题。
请参阅:升级react本机-community@react-2.0.0的本机权限解决了这个问题。
请参阅:抱歉,这不起作用-我正在使用expo许可证,这不起作用-我正在使用expo许可证