14

I am trying to get the GPS strength value to show if the signal is strong or weak. Does anyone know how to get the value.

Thanks in advance.

Luai Kalkatawi
  • 1,492
  • 5
  • 25
  • 51

4 Answers4

27

use the properties of CLLocation like horizontalAccuracy and verticalAccuracy which indicate how accurate the device believes that location fix to be.

and u can use

 if (someLocation.horizontalAccuracy < 0)
{
    // No Signal
}
else if (someLocation.horizontalAccuracy > 163)
{
    // Poor Signal
}
else if (someLocation.horizontalAccuracy > 48)
{
    // Average Signal
}
else
{
    // Full Signal
}

taken from link hope it helps. happy coding :)

Community
  • 1
  • 1
Anshuk Garg
  • 1,540
  • 12
  • 14
4

You could have used the excellent search function of stackoverflow and find this solution:

Finding GPS signal strength

Community
  • 1
  • 1
Lefteris
  • 14,550
  • 2
  • 56
  • 95
2

You don't have direct access to number of visible satellites or signal strength.

You could however calculate fake signal strength from accuracy.

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
   NSLog (@"accuracy: H:%.2f, V:%.2f", newLocation.horizontalAccuracy, newLocation.verticalAccuracy);
}
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
0

Just want to add to this topic since myself had the similar question. The accepted answer had the values all wrong. Please check my answer here:
https://stackoverflow.com/a/72131216/2841538.

List of accuracy values:

extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation; // (raw value: -2)
extern const CLLocationAccuracy kCLLocationAccuracyBest; // (raw value: -1)
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters; // (raw value: 10)
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters; // (raw value: 100)
extern const CLLocationAccuracy kCLLocationAccuracyKilometer; // (raw value: 1000)
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers; // (raw value: 3000)
us_david
  • 4,431
  • 35
  • 29