ionic 3 - iOS 策略位置权限模式警报消息

ionic 3 - iOS policy location permission modal alert message

我使用 Ionic 3 开发了一个使用地理定位 iOS 的应用程序。该应用程序被拒绝我需要更改应用程序对位置消息的请求。

我遵循了 cordova 地理定位插件页面中提到的 iOS 怪癖,但运气不佳:

<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>need location access to find things nearby</string>
</edit-config>

我尝试了另一个变量 NSLocationAlwaysUsageDescription,并且尝试了两个变量。我卸载并重新安装地理定位插件。我尝试了很多 "similar" 问题的答案,但似乎没有任何效果。

注意事项:

请有人帮助我。

根据 documentation,您必须将此密钥添加到您的 Info.plist :

NSLocationWhenInUseUsageDescriptionNSLocationAlwaysAndWhenInUseUsageDescriptionNSLocationAlwaysUsageDescription

You are required to include the NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription keys in your app's Info.plist file. (If your app supports iOS 10 and earlier, the NSLocationAlwaysUsageDescription key is also required.) If those keys are not present, authorization requests fail immediately.