iOS - How to detect if app has cellular data blocked

1k views Asked by At

I am using this code for detecting if there is internet connection:

Reachability *networkReachability = [Reachability reachabilityForInternetConnection];
    NetworkStatus networkStatus = [networkReachability currentReachabilityStatus];
    if (networkStatus == NotReachable) {
        [UIView showSimpleAlertWithTitle:nil
                                 message:locs(@"8614aa-alert_connection_message", lpos_alert_message)
                       cancelButtonTitle:@"OK"];
        return;
    }

It works. But I have problem when there is cellular data connection and my app is blocked. It returns WWAN but I can't connect. So how can I detect if my app is blocked or not? Thanks

0

There are 0 answers