0

I have an application which needs to access both a back-end server and third-party API (Google, Cloudmade etc.) throughout the application. There is no alternative and the connection is needed.

I am already doing a check with Tony Million's version of Reachability , see https://stackoverflow.com/a/3597085/3187198. I do this in the appDelegate, and would like to do something when the network status is NotReachable.

From a design perspective, I need to handle this, either by letting the user take action or give information, before closing the application. I have considered three scenarios:

A. The user gets an UIAlert, with the possibility to go to network settings via [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]]; but this is both an undocumented functionality and not functioning beyond 5.1

B. Inform the user via UIAlert, with "exit" as confirmation, and then exiting the application with exit(0). However, this behaviour is also forbidden and will cause the application to be rejected by Apple.

C. Setting UIRequiresPersistentWiFi = YES in the AppName-Info.plist, but this is a bit over the top, as it the app do not require consistent wifi/3G, and this will not prompt for missing network if this is the case.

So, my question is, what is the recommended way to handle the NotReachable case?

Community
  • 1
  • 1
Henrik_K
  • 3
  • 2

1 Answers1

0

Simply inform the user about the issue through an UIAlert. Do not allow any choice about, simply show an OK button. When the user taps the OK button, update the UI so that when the user triggers again the action required in that context, you check again the network status. If the network is reachable, allow the user going on, otherwise, simply display again the alert.

Massimo Cafaro
  • 25,429
  • 15
  • 79
  • 93
  • Not the best solution usability-wise, but the only one possible as of now. I do not like these continuous alert-prompts waiting for the user to either go to settings or close the app, especially when providing an option to go to network settings in the alert used to be possible. That also seem to be what Apple does internally. Prompting users without showing "a way out" is bad in terms of usability - this resembles web-forms pre-validation days. Answer accepted :) – Henrik_K Jan 12 '14 at 20:40