Limit iPhone Wi-Fi App

Is it possible to restrict the iPhone application to only work if there is a Wi-Fi connection (and not 3G)?

+4
source share
3 answers

Yes. There are two steps:

First you need to add the UIRequiresPersistentWiFi key to your Info.plist applications. This ensures that the Wi-Fi connection does not fall asleep while your application is open.

Secondly, you need to query the system (using the SCNetworkReachability API) to find out which radio is currently on. See this question in the iPhone documentation.

+7
source

You can also get the Reachability class from the Reachability sample from the apple dev center. It offers a way to check how iphone is connected.

+3
source

Networking and the Internet

If your application requires WiFi, you need to add the UIRequiresPersistentWiFi key to Info.plist and set True. This key notifies the system that the application is using a Wi-Fi network for communication.

0
source

Source: https://habr.com/ru/post/1312293/


All Articles