简体   繁体   中英

Launch Settings app using private api

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.

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.

没有Facebook帐户 - 设置示例

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM