Is it possible to restrict an iPhone app to only work if there's a Wifi connection (not 3G)?
Yes. There are two steps:
First, you need to add the UIRequiresPersistentWiFi key to your applications Info.plist
. This ensures that the WiFi connection does not go to sleep while your application is open.
Secondly, you need to query the system (using the SCNetworkReachability
API) to see which radio is currently enabled. See this question in the iPhone documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With