How to detect if device has GPS?

Discussion in 'iOS Programming' started by sanPietro98, Jan 8, 2009.

  1. macrumors 6502a

    sanPietro98

    Joined:
    May 30, 2008
    Location:
    28.416834,-81.581214
    #1
    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.
     
  2. macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #2
    You sure you want to do that? You can still get location data from Wifi and cellular networks with Core Location.
     
  3. macrumors 68000

    Joined:
    Nov 3, 2007
    #3
    Code:
    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.
     

Share This Page