ios - Accessing Settings app values and opening it if needed -


i have seen there known apps, such twitter , facebook, display "turn off airplane mode or use wi-fi access data" message within alert view, button switches settings app, when no network detected app goes foreground. message same in apps saw it, alert view kind of predefined 1 can use? similar 1 displayed when checking locationservicesenabled...

i found posts dealing issue time ago, example: ios uialertview button go setting app, , seems (or seemed) way read values in ios' settings app, couldn't find of in apple developer's documentation... there public api accessing values? app rejected if accessing them in post linked?

thanks in advance

till ios 5.0, can use url scheme open settings app third-party apps using urlscheme like:

[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"prefs:root=wifi"]]; 

unfortunately, ios 5.1 , ios 6 not supports feature.

you can use reachability checking wi-fi state.

for displaying default alertview when wi-fi off or in airplane mode can use application uses wi-fi flag in info.plist

refer infoplistkeyreference details:

uirequirespersistentwifi

“application uses wi-fi”

specifies whether app requires wi-fi connection.


Comments