How do I force an iOS app to use 3G instead of WiFi?

后端 未结 3 716
逝去的感伤
逝去的感伤 2020-12-16 07:57

I want to use a messaging protocol that works fine over 3G, but not over some corporate firewalls. How can my app force the use of the cellular network when it fails to conn

3条回答
  •  无人及你
    2020-12-16 08:00

    http://iphonedevsdk.com/discussion/comment/120957

    From the looks of that thread, it seems like its impossible. Your best bet may be to try using the protocol, and saying something like "please disconnect from wifi and retry" if it doesn't work.

    This thread says just about the same thing:

    how to programatically start 3g connection on iphone?

    You can use the Reachability class which apple wrote in order to test whether the network connection is currently over 3G or WiFi, and even to check if a specific resource is available on the network.

提交回复
热议问题