在任何情况下我都可以阻止iPhone使用3G吗? [英] Can I prevent iPhone from using 3G under any circumstances?

查看:133
本文介绍了在任何情况下我都可以阻止iPhone使用3G吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个旅行指南相关的应用程序,它可以在海外下载大型数据库(60meg),我可以通过wifi或3g访问主机时可以看到的可达性代码但是我担心如果由于某种原因wifi连接中断了一分钟左右,因为有些DSL连接很可能会有时会将iphone透明地切换到3G而且没有意识到我可能会收到海外数据费用的电话账单!

I'm writing a travel guide related app that will download large databases (60meg) potentially overseas, with the reachability code I can tell when a host is reachable via wifi or 3g BUT I'm worried that if for some reason the wifi connection breaks for a minute or so as some DSL connections are likely to do on occasion the iphone will switch transparently to 3G and without realising I could be racking up someones phone bill with overseas data charges!

所以我想知道是否有人有任何经验,如果wifi连接中断(wifi仍然有效,但它与网络的连接已关闭)可达性代码报告ReachableViaWWAN?所以我可以等到我的下载代码返回,检查主机当前是如何可以访问的,如果它是通过3g我可以中止?

So I'm wondering if anyone has any experience, in the event of such break in wifi connectivity (wifi still works but it's connection to the net is down) would the reachability code report ReachableViaWWAN? So I could wait till my download code returns, check how the host is currently reachable and if it's via 3g I could abort?

是否可以选择什么类型的连接我可以独家使用aka 3g或wifi吗?

Is it possible to select what type of connection I can use aka 3g or wifi exclusively?

推荐答案

如果查看Reachability示例,请在 可达性。 h ,有一个常量定义为 kReachabilityChangedNotification 。如果您要求收到更改通知 - 假设这听起来像是这样 - 您可以在下降到3G时停止连接。

If you look in the Reachability sample, in Reachability.h, there's a constant defined as "kReachabilityChangedNotification." If you ask to be notified of changes—assuming that this works as it sounds like it does—you could stop the connection when it drops down to 3G.

这篇关于在任何情况下我都可以阻止iPhone使用3G吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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