If you want the app to pass the audit, you must make a judgment on the network environment, in the absence of the network when the reminder and other processing.
The method of acquiring/detecting network state is described in Apple's routine reachability. To use reachability in an application program, first complete the following two parts:
1.1. Add the source file:
Use reachability in your program to copy only the Reachability.h and reachability.m in the routine to your project. Such as:
1.2. Add the framework:
Add systemconfiguration.framework into the project. Such as:
2. Network status
Three network states are defined in Reachability.h:
typedef enum {
notreachable = 0,//no connection
Reachableviawifi,//Use 3G/GPRS Network
Reachableviawwan//Use WiFi network
} networkstatus;
So you can check network status like this:
reachability *r = [reachability reachabilitywithhostname:@ "www.apple.com"];
switch ([R Currentreachabilitystatus]) {
Case Notreachable:
No network connection
Break
Case Reachableviawwan:
Using 3G Networks
Break
Case Reachableviawifi:
Use WiFi network
Break
}
Check:http://blog.sina.com.cn/s/blog_6f40a0e70100srip.html
IOS: Network detection