Hi I have an app that gives you locations on the mapview, is there any method to implement on an IF.
I would like my app to check if you don't have the gps active instead of showing you the map it will show you an image saying you don't have connection.
I would like to do something similar if you don't have signal as well.
The answer is yes, it's possible to track mobile phones even if location services are turned off.
Go to Settings > Privacy, then select Location Services. Select an app, then turn Precise Location on or off.
You can check whether the user denied the location services for you application by
[CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied
Otherwise you can also check whether location services are available at a system level by
[CLLocationManager locationServicesEnabled]
So the check you may want to perform in your app looks like
if([CLLocationManager locationServicesEnabled] &&
[CLLocationManager authorizationStatus] != kCLAuthorizationStatusDenied) {
// show the map
} else {
// show error
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With