How to check network type in iPhone app

Last week we sent our app to the apple. Yesterday we received a response from them. Mostly our application plays video from IIS. Now we do not check the type of network at all. It also plays video without wi-fi. But the apple asks us to limit it to playing only with Wi-Fi. So now I need to check the type of network connection.

Can anyone post code or any existing libraries to perform this function.

Thanks a lot.

+3
source share
1 answer

You can use:

SCNetworkReachabilityFlags flags;
SCNetworkReachabilityGetFlags (target,&flags)
);

To get network status:

if (flag & kSCNetworkReachabilityFlagsIsWWAN)
  // 3G/Edge/GPRS
else
  // Wifi
+3
source

Source: https://habr.com/ru/post/1710895/


All Articles