2

How to detect if GPS is available?

The iPod touch and iPad WiFi version don't have GPS, they have something else based on WiFi. Anyway, how to know if GPS is available? Or how to detect iPod Touch or iPad Wifi model?

Jonathan Gurebo
  • 285
  • 1
  • 6
  • 19

3 Answers3

2

This is a common difficulty on iOS... One way would be to get a location and check if the altitude is present.

  • if a valid altitude is present, the position has most probably been computed using GPS
  • else either the GPS has not picked-up any signal yet or it is not present.

Anyway on iOS Apple has a single interface for all location providers because they intend the developers to express their requirements in terms of accuracy, the control of the technology used should be left to the OS.

Stéphane
  • 6,920
  • 2
  • 43
  • 53
  • my experience is that cell tower location sometimes also reports altitude, I am not 100% sure, but i often have a more or less valid altitude, inside my apartment (vertcial accuracy <20m, while having 1000m horicontal accuracy) – AlexWien Jun 06 '13 at 20:20
1

Not sure yet if my solution will cover every device... but... What I do is if it's an iPad ask if the device has a cellular connection (Know if iOS device has cellular data capabilities). If so, it will most likely also have GPS. Not sure if this will cover every device correctly, but at least my test-devices are detected correctly.

Community
  • 1
  • 1
Georg
  • 3,664
  • 3
  • 34
  • 75
0

To be 100% sure that it is a GPS loaction, check for attribute course. if this is valid then its from GPS. but when not moving course is invalid too.
you can use that condition as initial trigger that now you have GPS.

If you need an initial valid GPS when not moving, check for vertical accuracy < 100 and horicontal < 50m

AlexWien
  • 28,470
  • 6
  • 53
  • 83