PDA

View Full Version : How to detect if device has GPS?




sanPietro98
Jan 8, 2009, 08:57 PM
Is there a way to detect if a device has GPS capabilities? I want to disable a button if the user is running an iPod Touch or First Gen iPhone.

The Core Location Services examples from Apple don't seem to reflect this. Thanks in advance.



jeremy.king
Jan 8, 2009, 09:12 PM
You sure you want to do that? You can still get location data from Wifi and cellular networks with Core Location.

Jeremy1026
Jan 8, 2009, 10:11 PM
UIDevice *myCurrentDevice = [UIDevice currentDevice];
NSLog(@"%@",[myCurrentDevice model]);

Will tell you what type of device you have, either iPod Touch or iPhone. This could be useful because no matter what you can use find an (approx.) location with the Phone, where with the iPod you need to be connected to WiFi in a documented WiFi Hot Spot to get a proper location.