【发布时间】:2021-05-11 12:06:39
【问题描述】:
我正在使用 react native 跟踪 @hmscore/react-native-hms-location 文档,我正在尝试使用 requestLocationUpdatesWithCallback() 和 addFusedLocationEventListener() 函数持续获取位置信息 我可以从 requestLocationUpdatesWithCallback() 获取请求代码,但 addFusedLocationEventListener() 什么也不返回,就像它没有触发一样
HMSLocation.FusedLocation.Native.requestLocationUpdatesWithCallbackEx(locationRequest)
.then((res) => console.log(res))
.catch((err) => alert(err.message))
////////////////////////
HMSLocation.FusedLocation.Events.addFusedLocationEventListener(handleLocationUpdate)
/////////////////////
const handleLocationUpdate = (locationResult) => console.log(locationResult)
任何解决方案
【问题讨论】:
-
您好,您的问题解决了吗?我也有同样的问题,如果你解决了,能分享一下你是怎么解决的吗?非常感谢
标签: react-native location huawei-mobile-services huawei-location-kit