iOS跳转到具体某个应用的设置

来源:互联网 发布:澳大利亚淘宝 编辑:程序博客网 时间:2024/06/05 08:30

跳转到系统设置界面:

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

如果我们想从应用bundleID:com.app.app的APP内跳转到系统设置中该应用的设置:

[[UIApplication sharedApplication]openURL:[NSURLURLWithString:@"prefs:root=com.app.app"]];

跳转url为prefs:root=com.app.app"所以如果你想跳转到具体某个应用的设置,就必须知道该应用的bundleID

再例如,如果跳转到通知设置中该应用的设置:
跳转url为:prefs:root=NOTIFICATIONS_ID&&path=com.app.app


在URL Types添加 一个叫prefs的URL Schemes,如图:


添加 Schemes

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"跳转不同界面对应的URLString"]];详见如下:

prefs:root=General&path=Aboutprefs:root=General&path=ACCESSIBILITYprefs:root=AIRPLANE_MODEprefs:root=General&path=AUTOLOCKprefs:root=General&path=USAGE/CELLULAR_USAGEprefs:root=Brightnessprefs:root=General&path=Bluetoothprefs:root=General&path=DATE_AND_TIMEprefs:root=FACETIMEprefs:root=Generalprefs:root=General&path=Keyboardprefs:root=CASTLEprefs:root=CASTLE&path=STORAGE_AND_BACKUPprefs:root=General&path=INTERNATIONALprefs:root=LOCATION_SERVICESprefs:root=ACCOUNT_SETTINGSprefs:root=MUSICprefs:root=MUSIC&path=EQprefs:root=MUSIC&path=VolumeLimitprefs:root=General&path=Networkprefs:root=NIKE_PLUS_IPODprefs:root=NOTESprefs:root=NOTIFICATIONS_IDprefs:root=Phoneprefs:root=Photosprefs:root=General&path=ManagedConfigurationListprefs:root=General&path=Resetprefs:root=Sounds&path=Ringtoneprefs:root=Safariprefs:root=General&path=Assistantprefs:root=Soundsprefs:root=General&path=SOFTWARE_UPDATE_LINKprefs:root=STOREprefs:root=TWITTERprefs:root=General&path=USAGEprefs:root=VIDEOprefs:root=General&path=Network/VPNprefs:root=Wallpaperprefs:root=WIFIprefs:root=INTERNET_TETHERING

版权声明:出自MajorLMJ技术博客的原创作品 ,转载时必须注明出处及相应链接!

原创粉丝点击