检测app是否允许链接网络 -----需要引入SystemConfiguration.framework。
#import "Reachability.h"
-(BOOL)determineNetworkLinks {
Reachability *reachabilityManager = [Reachability reachabilityWithHostName:@"www.baidu.com"];
if (reachabilityManager.currentReachabilityStatus == NotReachable) {
// NSLog(@"没有打开权限");
returnNO;
}
return YES;
}
网友评论