Skip to content
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

This callback type only permits a single invocation from native code #231

Open
cnpmge opened this issue Sep 4, 2019 · 2 comments
Open

Comments

@cnpmge
Copy link

cnpmge commented Sep 4, 2019

this.listener = Location.addLocationListener(location => {
this.setState({location});
const coord={
latitude:location.latitude,
longitude:location.longitude,
}
const latitude=location.latitude
const longitude=location.longitude
global.latitudeGlobal=location.latitude
global.longitudeGlobal=location.longitude
this.setState({
latitude,longitude
})
Geocode.reverse(coord).then(
(Promise)=>{
var city=Promise.city
this.setState({city})
global.cityglobal=Promise.city
}
);
})
我是在componentDidMount函数里调用的这个监听,获取到了城市,获取到了经纬度,多次测试,报这个错的时候非常少,10次里面只有一次会出现这种情况,请问这个的原因是什么呢?

@cursor99
Copy link

我也碰到,同问

@gufengpiaoyi
Copy link

同问,一般出现在第一次打开app定位的时候,第一次不行,再试就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants