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

Cant stop updates of RNLocation.subscribeToLocationUpdates #170

Open
maueli opened this issue Aug 4, 2021 · 1 comment
Open

Cant stop updates of RNLocation.subscribeToLocationUpdates #170

maueli opened this issue Aug 4, 2021 · 1 comment

Comments

@maueli
Copy link

maueli commented Aug 4, 2021

How can I stop updates? If "stops" == "unsubscribe" so... not work. Even If I define RNLocation.subscribeToLocationUpdates in a constant is not called so I dont have any update. But If I started IT never ends!

@skvaghasiya402
Copy link

Hello, please try this trick -

_startUpdatingLocation = () => {
this.locationSubscription = RNLocation.subscribeToSignificantLocationUpdates(
async ([ locations ]) => {
console.log(locations)
}
)
};

_stopUpdatingLocation = () => {
this.locationSubscription && this.locationSubscription();
console.log('locations stop')
};

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

2 participants