My app has been rejected in the Apple app-store.
To fix this, it must use only WiFi and not cellular network connection when the user is using the application. The application uses UIWebView -- how can we go about implementing this restriction?
Any help will be appreciated, Thanks!
For instance, to limit mobile data use for an app, tap the cellular data icon to its extreme right. Otherwise, tap the Wi-Fi icon next to it to restrict the app from running on a Wi-Fi network. Select both icons to stop an app from using data at all.
The same setting on Android phones can be found in the Connections area of the Settings app. Go to the WiFi settings, tap the three dots in the corner to find the advanced settings menu, and then turn off the toggle that says "Switch to mobile data."
Set cellular data use for apps and servicesGo to Settings > Cellular, then turn Cellular Data on or off for any app (such as Maps) or service (such as Wi-Fi Assist) that can use cellular data. If a setting is off, iPhone uses only Wi-Fi for that service. Note: Wi-Fi Assist is on by default.
Take a look at the Reachability example from Apple.
With that, you can query the device about the current network status, so you can know if Wifi is available, or if a connection will need cellular network. In the last case, you may display an alert, and prevent your UIWebView to load the data.
EDIT
If you have imported the reachability class into your project, and added the required framework(s), here's an example. This will test for 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! */
}
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