yayaa / LocationManager

Simplify getting user's location for Android
806 stars 187 forks source link

How to check if user turned on location? #73

Closed IHNEL closed 6 years ago

IHNEL commented 6 years ago

In my app we allow user to use with or without location. When user turn it off, we load generic data items, and if they turned on we want to get user location before loading data item nearby.

Is there anyway to quickly check if user turned on location settings or we have enough information to get user location?

yayaa commented 6 years ago

You mean, you don't want to ask user anything and get location if conditions are eligible, and fallback if they are not sufficient?

Yes, you can use the silent configuration and load generic data on failure.

It will not ask for permission or turning on gps or dealing with GooglePlayServices, it will wait until it gets the location though, if user has sufficient providers enabled.