-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS真机调试必须reloading app... 后才能获取定位信息 #35
Comments
"react-native": "0.67.2" |
这个我之前也发现了,我重新申请了 官方客户说,地图报 INVALID_USER_KEY 错误是,“key不正确或过期,开发者发起请求时,传入的key不正确或者过期” |
我自己的key和公司给的key都是昨天刚生成的,两个key在热更新一次后都能正常获取定位 看上去并不是key不对,因为热更新后能正常定位。而且报这个错的时候app还在加载阶段。 |
"@uiw/react-native-amap-geolocation": "2.0.0-alpha.2" 依赖包版本是2.0.0-alpha.2 |
@xiaobc1234 你看看它就 6行代码的实现,你可以咨询一下高德地图的客服,我也是咨询客服,换了 key 然后就好了。 react-native-amap-geolocation/index.js Lines 13 to 15 in 55e502c
react-native-amap-geolocation/ios/RNAMapGeolocation.m Lines 45 to 47 in 55e502c
|
已经找到问题,可能是这个 @xiaobc1234 |
感觉是你的包里 init方法调用时机问题,我换成 react-native-amap-geolocation 这个库之后 就正常了。
|
@xiaobc1234 已经修复 |
初始化的代码放在 useEffect里,其他地方没有 AMapGeolocation 类的引入和使用。在xcode本地启动后会有如下报错, 但此时app还在lunach阶段, 并且后面定位一直不会获取。
如下操作 刷新app之后就能开始正常获取定位信息
The text was updated successfully, but these errors were encountered: