I need a notification when device has WiFi connection is available or Device get connect via WiFi. I need to do some stuff only when WiFi is available.
I have used following code from Reachability:
BOOL status=true;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
internetReachability = [Reachability reachabilityForInternetConnection];
[internetReachability startNotifier];
NetworkStatus internetNetworkStatus = [internetReachability currentReachabilityStatus];
status = (internetNetworkStatus == ReachableViaWiFi);
But checkNetworkStatus: method not called properly and accurately. So, please guide me to solve this problem.
Any help to solve problem must be appreciated.
The following way is help me to solve my problem:
I hope it will help you in your problem.
}