2

How can I launch the iPhone settings app from my own app? For example, like the screen shot I got from twitter app below: enter image description here

I turned off the network, and the twitter shows me a network error alert. But in the alert view, they implement a button "Settings". When I press the button, it brings the iPhone settings app up.

So I am curious on if there any methods can be called to do this?

Thanks in advance.

Jing
  • 1,935
  • 3
  • 17
  • 26
  • dupe: http://stackoverflow.com/questions/4496813/call-the-official-settings-app-from-my-app-on-iphone – edc1591 Aug 30 '11 at 21:29
  • @edc1591 The topic may be a dupe, but the question is better and specific to the AlertView shown. One of the comments of one of the answers actually gives the solution to reproducing the behavior. – lilbyrdie Sep 11 '11 at 19:51

2 Answers2

2

I don't believe so. This dialog is provided by Apple when data is not available for an app that has set Wifi as a requirement in its info plist.

jin
  • 735
  • 3
  • 10
  • But it seems this is provided by the Twitter application, not Apple. – Baub Aug 30 '11 at 21:51
  • It is provided while the Twitter application is running by Apple based on the application's configuration. Similar to iPod music playing in the background while your app is running. – jin Aug 30 '11 at 22:05
  • How would one do that (configure their application to note that an internet connection is needed)? – Baub Aug 30 '11 at 22:17
  • 2
    Set this info.plist key to YES http://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW12 – jin Aug 30 '11 at 22:45
  • @jin Thanks, if I set "UIRequiresPersistentWiFi" key to YES, if I am using 3G to connect internet, will this alert show? – Jing Aug 31 '11 at 02:55
  • @Jing I believe so, but not 100% sure. – jin Aug 31 '11 at 05:03
  • It won't show in that situation, @Jing. In another part of that page, Wi-Fi is referred to as "the networking feature" of the device. When I turn my Wi-Fi off, but have 3G on, the app launches normally. Only with Wi-Fi & 3G off will it display this dialog. I don't know what will happen on EDGE. It will also display the dialog if you switch away from the app, turn off networking, and switch back. – lilbyrdie Sep 11 '11 at 19:49
0

Typically you would need to use custom URL schemes to access other Apple apps, but settings is not available and not part of this list.

Example:

http://wiki.akosma.com/IPhone_URL_Schemes

http://software-security.sans.org/blog/2010/11/08/insecure-handling-url-schemes-apples-ios/

TommyG
  • 4,145
  • 10
  • 42
  • 66