Friday 15 August 2014

iphone - Prevent AFNetworking Reachability Status Getting Called at First Launch for iOS -


I just want to know how to stop my warning view every time I open my app which is already Connected to the Internet I am using ARC if it helps.

This is in my app delegate to my AdWords launch with option system:

  __ weak id = self; // Warning silence for the cycle of maintaining _httpClient = [AFHTPP Client Client WITES: URL: [NSD URL URL string: @ "http://apple.com"]]; [_httpClient setReachabilityStatusChangeBlock: ^ (AFNetworkReachabilityStatus Status) {Switch (Status) {Case AFNetworkReachabilityStatusNotReachable: {// Accessible NSLog (@ "Not Connected to Internet"); UIAlertView * alert = [[UIAlertView alloc] initWithTitle: Zero Message: @ "Not Connected to Internet" Representative: Cancel YourselfTitton: Any other Button: @ "Dismiss", zero]; [Alerts show]; break; } Case AFNetworkReachabilityStatusReachableViaWiFi: {NSLog (@ "Connect to the Internet via WiFi"); UIAlertView * alert = [[UIAlertView alloc] initWithTitle: Zero Message: @ "Connect to the Internet via WiFi" Representative: Cancel yourselfTintonit: Any other buttontite: @ "Dismiss", zero]; [Alerts show]; break; } Case AFNetworkReachabilityStatusReachableViaWWAN: {NSLog (@ "Connect to the Internet via WWAN"); UIAlertView * Warning = [[UIAlertView alloc] initWithTitle: Zero Message: @ "Connect to the Internet" Representative: Cancel Yourself: TitanTitle: Any other Button: @ "Dismiss", zero]; [Alerts show]; break; } Default: Break; }}];   

Any help would be appreciated thanks!

Echoing @ D80 Book: Do not pop an alert just for access. It is totally unnecessary, and does not add anything to the user's experience (it is not as if the user can do anything to correct the lack of accessibility). If anything, you can show a non-model signal of network accessibility.

No comments:

Post a Comment