Home > OS >  Xcode-Swift 5: Is it possible to turn off the GPS requirement when launching iOS app on a WiFi only
Xcode-Swift 5: Is it possible to turn off the GPS requirement when launching iOS app on a WiFi only

Time:07-09

I have an app written in Swift 5 using Xcode 13.3.1 that has sensor reads but also a speedometer that works by using GPS which is set as a requirement in "Custom iOS Target Properties" to track speed which works great on an iOS Phone as there is cell service but I want to run the app in an iPad that is Wifi only- no cell service. When I try to run the app in Xcode using the iPad as a test device, it stops on install saying that it can not install because the iPad doesn't support GPS. I'm wondering if there is a way to disable the need for GPS in the Info Target Properties or in code, when a device that is WiFi only is attached? I'm fine with the fact that the Speedometer will not function as a result, but the sensor reads will still work.

CodePudding user response:

GPS which is set as a requirement in "Custom iOS Target Properties"

That's the wrong approach. Basically using required hardware properties is frowned on. Just install anywhere, and then fail gracefully if the user tries to employ a feature that requires hardware that isn't there.

  • Related