turn on 3g mobile data programatically in ios device

844 Views Asked by At

I searched i could not find a proper answer. I want to turn on device's 3g data ON from my ios application. My scenario is initially, I will check whether internet is reachable via wifi/ 3g. If both are not available, I should turn ON device 3g data. I should be able to do it without the help of third party library. Please help me out.

2

There are 2 best solutions below

5
Apurv On

It is not possible. you can not do it via your application. You can let the user know to go to settings page and turn on the data. But with out user's interaction, it is not possible.

0
SomeGuy On

No the closest you can get is by setting the UIRequiresPersistentWifi boolean in your info plist, which will make iOS present an alert with a button to the settings app, but it also means your app will always show this when opened if you're not connected to wifi (even if you're still on 3G)