Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I prevent iPhone from using 3G under any circumstances?

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!

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?

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

like image 958
dageshi Avatar asked Jun 11 '10 14:06

dageshi


2 Answers

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.

like image 70
Jeff Kelley Avatar answered Sep 17 '22 12:09

Jeff Kelley


Under Settings->General->Network there is "Data Roaming". This allows you to turn off roaming onto other data networks when traveling internationally. The user already has a choice there whether to allow expensive 3G connections when traveling.

like image 39
progrmr Avatar answered Sep 19 '22 12:09

progrmr