I can't find a method to check "GPS-Chip exists in a iDevice"
I want to give user a hint that without GPS the location is less accurate than with GPS
greetings from cloudy germany
I can't find a method to check "GPS-Chip exists in a iDevice"
I want to give user a hint that without GPS the location is less accurate than with GPS
greetings from cloudy germany
Either the device has a Gps chip or not. If not, a hint to the user is not always helpfull, the user would have to buy a new phone to solve the situation.
However there are many other reasons for having that information.
You must distinguish betwenn:
1. device has no Gps
2. current location was not delivered by GPS, but via an alternate locationing provider. (cell tower/ wifi)
3. user has disabled location delivery for you app.
your question was topic 1:
this is solveable by getting the current device modell (via machine name), then look up the modell, and make your own list which device has gps. Look at post from user boxel in detect ipad mini to show the technic.
However this is not future proof and works only for the known models and in generall not very recommended.
Or you state in the plist file of your app that you need a device with Gps, then it will only be installed to such devices.
2) you can look up current speed and course, if valid this is only delivered by GPS or device is not moving. (then you may look up horicontal accuarcy < 30m).
3) was answered by post of anirudcc
You can use this category which has a function
-(BOOL) supportsCapability: (NSString *) capability;
BOOL hasGPS = [UIDevice supportsCapability:UIDeviceGPSCapability];
I hope it helps.
Or this works as well:
//Use classLoaders to avoid crashes on iPhone OS 3.x
id netInfo = [[NSClassFromString(@"CTTelephonyNetworkInfo") alloc] init];
if (netInfo)
{
id carrier = [netInfo subscriberCellularProvider];
if ([[carrier carrierName] length] <=0)
{
//NO operator=>NO 3G and no real GPS
}
}
2nd solution's source:Detect GPS Hardware in iphone
Use the locationServicesEnabled method in CLLocationManager