从 iPhone 上的我的应用程序调用官方 *设置* 应用程序
在我的应用程序中的某一时刻,我想将用户重定向到官方设置应用程序。如果可能的话,我还想直接进入设置应用中的网络部分。
我认为我需要的是设置应用程序的网址方案和构建我的请求的格式。但我怀疑调用这样的官方应用程序是否被禁止。
有人可以帮助我吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
正如下面的评论所述,这在 iOS 5.1 及更高版本中不再可能。
如果您使用的是 iOS 5.0,则以下情况适用:
现在可以在 iOS 5 中使用“prefs:”url 方案实现这一点。它可以通过网页或应用程序运行。
示例网址:
示例用法:
As noted in the comments below, this is no longer possible in iOS version 5.1 and after.
If you are on iOS 5.0, the following applies:
This is now possible in iOS 5 using the 'prefs:' url scheme. It works from a web page or from an app.
example urls:
sample usage:
从 IOS 8 开始,您可以使用以下命令从应用内调用设置:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
From IOS 8 you can call the settings from within app with this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
它也适用于 iOS 版本> 5.1,但是你必须在Xcode中的URL类型中添加一个URL方案:
然后你可以使用
它可以打开系统WiFi设置
现在。
其他路径请在此答案中找到: iOS Launching Settings ->限制 URL 方案。
It's also work in iOS version > 5.1, but you must add an URL schemes in URL types in Xcode:
Then you can use
It's can open system WiFi setting
now.
Other path please find in this answer: iOS Launching Settings -> Restrictions URL Scheme.
坏消息:正如 @Hlung 和 @jasongregori 所建议的,对于操作系统版本 >= iOS 5.1 && 的 iDevices < iOS 8.0 中,再次没有官方/记录的方式从第三方应用程序调用内置设置应用程序。时期。
Bad news: As @Hlung and @jasongregori suggested, for iDevices whose OS version >= iOS 5.1 && < iOS 8.0, there is once again NO official/documented way to call the built-in Settings app from a third-party app. Period.
仅可在 iOS 8 中从其他应用程序调用设置应用程序。因此,请使用以下代码
Calling the settings app from other app is possible only from iOS 8. So, use the following code
从 iOS 8 开始,您可以通过
享受编码来重定向
from iOS 8, you can redirect with
enjoy coding
只是添加到 iOS8+ 的一个额外答案。如果您支持低于 8 的任何内容,您应该检查它是否受支持
Just an additional answer to add onto the one's addressing iOS8+. If you're supporting anything below 8, you should check to see if it's supported
对于 iOS 9 中的设置,这对我有用。
中的“URL 类型”中添加 URL 方案。
但请确保在应用程序目标的“信息”选项卡
For settings in iOS 9 this is worked for me.
But make sure you add a url schemes in URL types in
Info tab in app targets.
对于 iOS 10,您可以使用:
它也适用于 iOS 9!
For iOS 10 you can use:
It is also working on iOS 9!