简体   繁体   English

使用私有API启动设置应用程序

[英]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? 由于打开带有prefs:// URL的Settings.app不再适用于iOS 5.1+,我想知道我是否可以使用私有API启动设置? NOTE: Not for the app store. 注意:不适用于应用商店。

Using Private APIs 使用私有API

GitHub Project iOS-Runtime-Headers GitHub项目iOS-Runtime-Headers

Here are iOS Objective-C headers as derived from runtime introspection. 以下是从运行时内省派生的iOS Objective-C头文件。

The headers were generated using RuntimeBrowser for iPhone . 标题是使用RuntimeBrowser for iPhone生成的。

Of specific interest to the Settings app, take a look at the Preferences.Framework . 设置应用程序特别感兴趣,请查看Preferences.Framework I've never worked with this directly, but there seems to be other SO questions on the topic: 我从来没有直接使用过这个,但似乎还有关于这个主题的其他SO问题:

  1. iOS Private API Documentation iOS私有API文档
  2. Does anybody know how I can find the the headers for IOS5 Iphones/ipod. 有谁知道如何找到IOS5 Iphone / ipod的标题。 Jailbreak development 越狱发展
  3. Get a screenshot while App is in background? 在App处于后台时获取屏幕截图? (Private APIs allowed) (允许私有API)
  4. More... 更多...

Using URLs 使用URL

According to this answer on SO , it is no longer possible to manually launch the Settings app using URLs . 根据SO上的这个答案 ,不再可以使用URL 手动启动“设置”应用。

Asked Apple through my developer account if there is a way to programmatically launch the WiFi Settings dialog. 通过我的开发人员帐户询问Apple是否有办法以编程方式启动WiFi设置对话框。 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. 但是,如果您使用的是本机Twitter或Facebook SDK,则会出现一个对话框,要求用户登录,如果不是。 More information from this SO question , with example image below. 来自此SO问题的更多信息,下面是示例图片。

没有Facebook帐户 - 设置示例

I don't have a particular answer. 我没有特别的答案。 However, I would build on previous answer about Facebook or Twitter. 但是,我会建立在之前关于Facebook或Twitter的答案。 I think, it make sense to disassemble Twitter or Social framework and find where this dialog is shown. 我认为,反汇编Twitter或社交框架并查找此对话框的显示位置是有意义的。 If you will find this place, you can check the code behind "Settings" button. 如果您找到这个地方,可以查看“设置”按钮后面的代码。

There should be some API which switches to Preferences. 应该有一些API切换到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. 但是,它可能是代码,它存在于某些具有权利的服务组件中,您将无法获得该组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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