简体   繁体   English

React Native应用在首次启动时会询问iOS位置权限,但是0引用了内部任何位置的地理位置/位置代码

[英]React Native app asks iOS location permissions on first launch, but 0 references to geo/location code anywhere inside

So I have a React Native app, and when testing in iOS, on first launch it always asks for location while in use (within 1 second of opening). 因此,我有一个React Native应用,当在iOS中进行测试时,首次启动时,它总是在使用时(在打开后1秒钟内)询问位置。 ie. 即。 "Allow XXX to access your location while you are using the app?" “在使用应用程序时允许XXX访问您的位置吗?” permission dialog. 权限对话框。

I am using react-native-permissions for other stuff, but I've searched and searched my code and have 0 references to "geolocation","location","navigator",etc. 我正在使用react-native-permissions进行其他操作,但是我已经搜索了我的代码,并且对“ geolocation”,“ location”,“ navigator”等有0个引用。 Basically there no location code or geolocation code anywhere to be found. 基本上在任何地方都找不到位置代码或地理位置代码。

Looking for help on how to diagnose this crazy issue. 寻找有关如何诊断此疯狂问题的帮助。 In my NPM modules, again nothing crazy there either that would depend on location. 在我的NPM模块中,同样也没有什么取决于位置的疯狂了。 I've even deleted the "NSLocationWhenInUseUsageDescription" from info.plist and app still launches, doesn't crash and never prompts location dialog! 我什至从info.plist中删除了“ NSLocationWhenInUseUsageDescription”,应用仍然启动,不会崩溃,并且从不提示位置对话框!

(This is on iOS 11.3) (这是在iOS 11.3上)

Looking for advice. 寻求建议。

Thanks 谢谢

Check your Info.plist, you probably have either of these keys, or both: 检查您的Info.plist,您可能拥有以下两个密钥之一,或同时拥有:

NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationAlwaysUsageDescription

As a result iOS will prompt for location access as soon as you launch your app. 因此,iOS在启动应用程序后将提示您进行位置访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM