简体   繁体   中英

Can I use only cellular network (3G or EDGE), even if WIFI is connected on the iPhone?

I was wondering whether I can use the cellular network (3G or 2G or whatever they may have) even if the WIFI is connected and working. I noticed that Apple has a "Reachability" sample code, but that would only tell me if I can connect using a cellular network; instead, I would like to actually use ONLY the cellular network.

Best Regards, Noam.

Definitely YES. You should combine Reachability notifications with network interfaces enumeration. And - this point is much important: use BSD socket's bind() call to bind to CONCRETE IP address. Don't use 0.0.0.0 and your app will be network-adaptive and awaring. My poor gist example: https://gist.github.com/avesus/fdb465b60a4f5204845c

No, I wouldn't imagine so.

My understanding is that if the device is connected to Wifi, 3G is not used for data and all data traffic travels via Wifi.

Only cellular data to another cellular device would use the phone provider's network.

我相信,完成此操作的唯一方法是检测用户是否使用WiFi(示例代码在您引用的“ Reachability”示例中),如果是,请提示他们在使用应用程序之前禁用WiFi。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM