Use only Wi-Fi connection (not cellular network) in the app?

My application was rejected in the Apple app store.

To fix this, he should use only Wi-Fi, not a cellular network, when the user uses the application. Application uses UIWebView - how can we implement this limitation?

Any help would be appreciated, thanks!

+6
source share
1 answer

Take a look at Reachability from Apple.

At the same time, you can ask the device about the current state of the network so that you know if Wi-Fi is available, or if you need a cellular network to connect. In the latter case, you can display a warning and prevent your UIWebView from loading data.

EDIT

If you have imported the reachability class into your project and added the necessary frame (s), here is an example. This will check if there is an available WiFi connection:

Reachability * reach; NetworkStatus status; reachability = [ Reachability reachabilityForLocalWiFi ]; status = [ reach currentReachabilityStatus ]; if( status == ReachableViaWiFi ) { /* Hurray, you've got a WiFi connection! */ } else { /* No WiFi connection - Alert the user! */ } 
+7
source

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


All Articles