Forcing WWAN connectivity on iPhone, even when Wi-Fi is available

I need to make a network connection via WWAN (i.e. mobile network) on the iPhone, even if the device is connected to a Wi-Fi network, however I cannot find a way to do this.

I tried to go down to the socket level and iterate through the available interfaces, however when connected to Wi-Fi, the WWAN interface (pdp_ip0) disappears.

The solution must be secure on the App Store.

+4
source share
3 answers

Perhaps you can use the Reachability code to determine if Wi-Fi is enabled by clicking UIAlertView to warn users to exit the application, open the Settings app and turn off the wireless connection manually. Not perfect, definitely.

+2
source

List the network interfaces, you will see that when you are connected on both Wi-Fi and 3G, there are 2 with different local IP addresses. You could use one against the other, forcing you to bind your socket on the right interface before sending data. A kernel that is trying to find the best interface to route your packet should be satisfied with your choice. Disclaimer: I have not tried this, this is just an offer.

+4
source

There is no supported way to do this. You must tell the user to disconnect the WiFi connection, because "this is a non-negotiable operational requirement for the service to which the application should connect."

In this case, the user is unlikely to kill you with bad reviews if it becomes clear to you why they should disable WiFi.

-t

+1
source

All Articles