我将尝试使用React Native获取iOS用户的位置。我已在plist中添加了位置隐私描述,并尝试了各种代码,但没有一个显示请求权限的对话框。目前,我正在使用这个库:https://github.com/yonahforst/react-native-permissions
我的请求位置权限的代码如下:
componentDidMount() {
Permissions.request('location', 'whenInUse')
.then(res => {
console.log(res);
})
这个操作没有任何效果。当我检查权限时,它显示为待定。
请注意,我的应用程序确实显示在位置隐私设置中。