Ios 反应本机不允许对话

Ios 反应本机不允许对话,ios,react-native,location,Ios,React Native,Location,我正在尝试使用React Native获取我的用户在iOS上的位置。我在plist中添加了位置隐私描述,我尝试了各种代码,但没有显示请求许可的对话。现在,我正在使用这个库: 我请求位置权限的代码如下: componentDidMount() { Permissions.request('location', 'whenInUse') .then(res => { console.log(res); }) 这没用。当我检查许可时,它说未确定 请注意,我的应用程序确实会显示

我正在尝试使用React Native获取我的用户在iOS上的位置。我在plist中添加了位置隐私描述,我尝试了各种代码,但没有显示请求许可的对话。现在,我正在使用这个库:

我请求位置权限的代码如下:

componentDidMount() {
  Permissions.request('location', 'whenInUse')
  .then(res => {
    console.log(res);
 })
这没用。当我检查许可时,它说未确定


请注意,我的应用程序确实会显示在位置隐私设置上。

如果其他人遇到此问题


当我在我的设备上运行它时,我的问题被修复了。出于某种原因,模拟器没有请求任何权限,也没有任何进展。

在使用react native 0.48.3 iOS 11.1时遇到同样的问题,解决方案是将所有现有位置权限添加到Info.plist

<key>NSLocationAlwaysUsageDescription</key>
<string>some string</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>some string</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>some string</string>
<key>NSLocationUsageDescription</key>
<string>some string</string>
NSLocationAlwaysUsageDescription
一些绳子
NSLocationWhenUse用途说明
一些绳子
N位置始终和何时使用说明
一些绳子
NSLocationUsageDescription
一些绳子

这显示了对话,也适用于iPhone模拟器

工作,但我不希望对话总是提供,在使用时,只是始终提供。