美文网首页iOS点点滴滴
iOS 10跳转到系统设置对应的页面

iOS 10跳转到系统设置对应的页面

作者: xiao小马哥 | 来源:发表于2017-03-29 17:45 被阅读195次

    判断用户有没有开启通知(没有跳转到通知界面)

    iOS10系统这个只能跳转到设置界面,不能具体到哪一个页面

        UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
        if (UIUserNotificationTypeNone == setting.types) {
            NSLog(@"推送关闭");
             [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
        }else{
            NSLog(@"推送打开");
        }
    

    所有需要使用系统的私有API来处理问题了
    需要添加类库文件:MobileCoreServices.framework

    6CC92113-093A-4A1C-A4B0-BE28F9A59454.png

    还需要在info.plist中添加这两个key对应的值如图,区分大小写(测试发现不添加也没用问题)

    53E500A4-1A10-49CC-B213-FF31C12F2791.png

    在需要跳转的地方添加如下代码

    NSURL*right_url=[NSURL URLWithString:@"Prefs:root=Bluetooth"];
    Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
    
    [[LSApplicationWorkspace performSelector:@selector(defaultWorkspace)] performSelector:@selector(openSensitiveURL:withOptions:) withObject:right_url withObject:nil];
    

    更换其中的字符串,实现跳转到不同的页面(注意:开通的p改为大写!!!!)

    About — prefs:root=General&path=About  
    
    Accessibility — prefs:root=General&path=ACCESSIBILITY  
    
    AirplaneModeOn— prefs:root=AIRPLANE_MODE  
    
    Auto-Lock — prefs:root=General&path=AUTOLOCK  
    
    Brightness — prefs:root=Brightness  
    
    Bluetooth — prefs:root=General&path=Bluetooth
    
    Date& Time — prefs:root=General&path=DATE_AND_TIME  
    
    FaceTime — prefs:root=FACETIME
    
    General— prefs:root=General
    
    Keyboard — prefs:root=General&path=Keyboard  
    
    iCloud — prefs:root=CASTLE  iCloud 
    
    Storage & Backup —  prefs:root=CASTLE&path=STORAGE_AND_BACKUP  
    
    International — prefs:root=General&path=INTERNATIONAL  
    
    Location Services — prefs:root=LOCATION_SERVICES  
    
    Music — prefs:root=MUSIC  
    
    Music Equalizer — prefs:root=MUSIC&path=EQ  
    
    Music VolumeLimit— prefs:root=MUSIC&path=VolumeLimit  
    
    Network — prefs:root=General&path=Network  
    
    Nike + iPod — prefs:root=NIKE_PLUS_IPOD  
    
    Notes — prefs:root=NOTES  
    
    Notification — prefs:root=NOTIFICATIONS_ID  
    
    Phone — prefs:root=Phone  
    
    Photos — prefs:root=Photos  
    
    Profile — prefs:root=General&path=ManagedConfigurationList  
    
    Reset — prefs:root=General&path=Reset  
    
    Safari — prefs:root=Safari  Siri — prefs:root=General&path=Assistant  
    
    Sounds — prefs:root=Sounds  
    
    SoftwareUpdate— prefs:root=General&path=SOFTWARE_UPDATE_LINK  
    
    Store — prefs:root=STORE  
    
    Twitter — prefs:root=TWITTER  
    
    Usage — prefs:root=General&path=USAGE  
    
    VPN — prefs:root=General&path=Network/VPN  
    
    Wallpaper — prefs:root=Wallpaper  
    
    Wi-Fi — prefs:root=WIFI
    
    Setting—prefs:root=INTERNET_TETHERING
    

    以下是常用APP的URL Schemes:

      “QQ”的url是 mqq:// 
      “微信”是 weixin:// 
      “淘宝”是 taobao:// 
      “点评”是 dianping://     dianping://search 
      “微博”是 sinaweibo:// 
      “名片全能王”是 camcard:// 
      “weico微博”是 weico:// 
      “支付宝”是 alipay:// 
      “豆瓣fm”是 doubanradio:// 
      “微盘”是 sinavdisk:// 
      “网易公开课”是 ntesopen://
      “美团”是 i**:// 
      “京东”是 openapp.jdmoble:// 
      “人人”是 renren:// 
      “我查查”是 wcc:// 
      “1号店”是 wccbyihaodian:// 
      “有道词典”是 yddictproapp:// 
      “知乎”是 zhihu://
      “优酷”是  youku://

    相关文章

      网友评论

        本文标题:iOS 10跳转到系统设置对应的页面

        本文链接:https://www.haomeiwen.com/subject/cfgxottx.html