nbojja
nbojja

Reputation: 1655

How to check network type in iPhone app

Last week we submitted our app to apple. Yesterday we got response from them. Basically our app plays the videos from IIS. Now we are not at all checking the network type. it is playing videos without wi-fi also. But apple is asking us to restrict it to play only with wi-fi. So now i need to check my network connection type.

can some on post the code or any existing libraries to do this functionality.

Thanks a lot..

Upvotes: 3

Views: 2733

Answers (1)

diederikh
diederikh

Reputation: 25271

You can use:

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

to get the network status:

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

Upvotes: 3

Related Questions