Xcode: How to show GPS strength value?

11,601

Solution 1

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 :)

Solution 2

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

Finding GPS signal strength

Solution 3

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);
}
Share:
11,601

Related videos on Youtube

Luai Kalkatawi
Author by

Luai Kalkatawi

Learning Swift :)

Updated on June 04, 2022

Comments

  • Luai Kalkatawi
    Luai Kalkatawi almost 2 years

    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.