1

Since opening Settings.app with a prefs:// URL no longer works in iOS 5.1+, I'm wondering if I can launch Settings using private APIs? NOTE: Not for the app store.

ninjaneer
  • 6,951
  • 8
  • 60
  • 104
  • This question doesn't mention whether jailbreaking is an option, but if it is, then you can use [the solution in my answer here](http://stackoverflow.com/a/15455831/119114), using the Settings app's bundle identifier of `com.apple.Preferences`. – Nate Apr 01 '13 at 09:05

2 Answers2

2

Using Private APIs

GitHub Project iOS-Runtime-Headers

Here are iOS Objective-C headers as derived from runtime introspection.

The headers were generated using RuntimeBrowser for iPhone.

Of specific interest to the Settings app, take a look at the Preferences.Framework. I've never worked with this directly, but there seems to be other SO questions on the topic:

  1. iOS Private API Documentation
  2. Does anybody know how I can find the the headers for IOS5 Iphones/ipod. Jailbreak development
  3. Get a screenshot while App is in background? (Private APIs allowed)
  4. More...

Using URLs

According to this answer on SO, it is no longer possible to manually launch the Settings app using URLs.

Asked Apple through my developer account if there is a way to programmatically launch the WiFi Settings dialog. Here is the response:

"Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations."

If, however, you are using the native Twitter or Facebook SDK, then a dialog will appear asking the user to login if they are not. More information from this SO question, with example image below.

No Facebook Account - Settings example

Community
  • 1
  • 1
Joe Masilotti
  • 16,815
  • 6
  • 77
  • 87
  • I think that question was referring to public API's. My question is specifically referring to private API's, perhaps it's achievable by linking to Springboard Services framework and importing private header files? I don't think the Twitter solution is viable for me, I'm currently working on an internal enterprise app, so there's no need for App Store approval. – ninjaneer Nov 15 '12 at 02:27
  • @Ninja Please see my updated response regarding private APIs. – Joe Masilotti Nov 15 '12 at 17:21
1

I don't have a particular answer. However, I would build on previous answer about Facebook or Twitter. I think, it make sense to disassemble Twitter or Social framework and find where this dialog is shown. If you will find this place, you can check the code behind "Settings" button.

There should be some API which switches to Preferences. However, it could be that code which does it lives in some service component which has entitlement, which you won't be able to get.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • Like the `com.apple.springboard.launchapplications` entitlement needed [by this solution](http://stackoverflow.com/a/15455831/119114) :( – Nate Apr 01 '13 at 09:07