这是 googleplace 中的文档的代码,但这是发生的
错误进行地点检测 api 调用:错误
RNGooglePlaces.getCurrentPlace()
.then((results) => alert(results))
.catch((error) => alert(error.message));
这是 googleplace 中的文档的代码,但这是发生的
错误进行地点检测 api 调用:错误
RNGooglePlaces.getCurrentPlace()
.then((results) => alert(results))
.catch((error) => alert(error.message));
根据这个 GitHub 问题,假设您使用的是tolu360 的 react-native-google-places 库,您应该检查以下内容:
ACCESS_FINE_LOCATION
许可。由于您需要一个特定的位置,因此您需要一个能够报告其位置以及访问该信息的权限的真实设备!
在库内的 RNGooglePlacesModule.java 的第 363 行,您可以添加一个断点以查看likelyPlaces.getStatus()
. 我建议您这样做并在您的问题中添加任何额外的信息。