却钏芘沂,金鱼品种,憨豆先生的大灾难国语
ios-app跳转至相关界面的四种方法。
(1)使用方式:
系统的wi-fi: prefs:root=wifi
(2)适于系统:
适用于方法二:prefs:root=某项服务&bundleid(1)使用方式:
app的通知:prefs:root=notifications_id&path=\(identifier)
(2)适于系统:
适用于>=ios8且方法三: uiapplicationopensettingsurlstring(1)使用方式:
app的设置界面:uiapplicationopensettingsurlstring
(2)适于系统:
适用于>=ios8的系统
方法四: app-prefs:root=某项服务&bundleid*
(1)使用方式:
app的通知界面:app-prefs:root=notifications_id&path=\(identifier)
(2)适于系统:
适用于>=ios8的系统
具体使用
(1)方法1/2/4:均需要在info中设置 urltypes中的url schemes(其它的无需设置)
(2)在swift中的具体使用:
//获取app的bundleid let bundleid = bundle.main.bundleidentifier! //跳转到不同的页面时,需要调整str let str = "app-prefs:root=notifications_id&path=\(bundleid)" let url = url.init(string: str)! uiapplication.shared.openurl(url)
(3)需要区分的是:
需要跳转至“系统设置”or“app对应的设置“,app需要添加对应的bundleid
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
网友评论