如何检查iPhone应用程序中的网络类型 [英] How to check network type in iPhone app

查看:108
本文介绍了如何检查iPhone应用程序中的网络类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上周我们将应用程序提交给了苹果。昨天我们收到了他们的回复。基本上我们的应用程序播放IIS中的视频。现在我们根本没有检查网络类型。它也播放没有Wi-Fi的视频。但苹果要求我们限制它只与wi-fi一起玩。所以现在我需要检查我的网络连接类型。

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.

非常感谢..

推荐答案

您可以使用:

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

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

这篇关于如何检查iPhone应用程序中的网络类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆