【问题标题】:react-native-google-places ERROR making places detection api call: ERRORreact-native-google-places 错误进行地点检测 api 调用:错误
【发布时间】:2019-01-17 15:48:31
【问题描述】:

这是 googleplace 中文档的代码,但这是发生的

制作地点检测 api 调用时出错:ERROR

  RNGooglePlaces.getCurrentPlace()
    .then((results) => alert(results))
    .catch((error) => alert(error.message));

【问题讨论】:

  • 您看到的实际错误是什么?
  • 错误进行地点检测 api 调用:错误

标签: android react-native google-places-api google-places


【解决方案1】:

根据this GitHub issue,假设您使用的是tolu360's react-native-google-places library,您应该检查以下内容:

  • 确保设备的 GPS 位置已开启。
  • 确保您已请求(并收到)ACCESS_FINE_LOCATION 许可。
  • 确保您使用的是真实设备,而不是模拟器。

由于您需要一个特定的地点,因此您需要一个能够报告其位置并获得访问该信息的权限的真实设备!

在库内的line 363 of RNGooglePlacesModule.java 上,您可以添加断点以查看likelyPlaces.getStatus() 返回的实际错误。我建议您这样做并在您的问题中添加任何额外信息。

【讨论】:

  • @AllenCris 为您添加了进一步的步骤。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-30
  • 2019-09-18
  • 1970-01-01
  • 1970-01-01
  • 2012-05-10
  • 1970-01-01
相关资源
最近更新 更多