gpt4 book ai didi

React-Native 的 navigator.geolocation 未定义

转载 作者:行者123 更新时间:2023-12-04 05:13:05 26 4
gpt4 key购买 nike

console.log(navigator.geolocation) //undefinedconsole.log(navigator) :

WorkerNavigator {hardwareConcurrency: 8, appCodeName: "Mozilla", appName: "Netscape", appVersion: "5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKi…L, like Gecko) Chrome/73.0.3683.103 Safari/537.36", …}
appCodeName: "Mozilla"
appName: "Netscape"
appVersion: "5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
connection: NetworkInformation {onchange: null, effectiveType: "4g", rtt: 100, downlink: 4.3, saveData: false}
deviceMemory: 8
hardwareConcurrency: 8
language: "en-US"
languages: (3) ["en-US", "en", "es"]
locks: LockManager {}
onLine: true
permissions: Permissions {}
platform: "MacIntel"
product: (...)
storage: StorageManager {}
usb: USB {onconnect: null, ondisconnect: null}
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
get product: ƒ getValue()
set product: ƒ setValue(newValue)
__proto__: WorkerNavigator

我在 iOS 上使用 React Native 0.59。

在 info.plist 中,我有两个: Privacy - Location When In Use Usage DescriptionPrivacy - Location Always and When In Use Usage Description
cocoa bean : http://dpaste.com/2W9Y57E
信息列表: http://dpaste.com/1CTG8GP

最佳答案

显然,其他人所说的任何事情都无法解决我的问题。
至少对我来说,我使用的是 RN 0.60,我发现他们将它(像许多其他包一样)提取到一个外部包中。
我当然考虑过,考虑到关于所谓的“精益核心”的决定,但在 rn 文档中没有写任何关于位置提取的内容。

所以这是包,在这里你可以找到配置它的新指南:
https://github.com/react-native-community/react-native-geolocation

不知道 0.59 是否也没有

关于React-Native 的 navigator.geolocation 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55995852/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com