Open Wifi Settings by “prefs:root=WIFI” failed in iOS 10

后端 未结 7 1387
太阳男子
太阳男子 2020-12-09 09:18

I was using prefs:root=WIFI url scheme in my app with prefs entered in info.plist to open directly the iOS settings application in Wi-Fi settings and it was working great on

相关标签:
7条回答
  • 2020-12-09 10:20

    My app is also using that api. Unfortunately apple disable this on iOS 10. Here's my solution: below iOS 10, it can still open Setting App. on iOS 10, it will go to a subpage(Cellular Data access) of Setting App, you can back to setting page by one click. I decide to keep it. because it's still convenient than user manually open Setting App.

    NSURL *url = [NSURL URLWithString:@"prefs:root=WIFI"];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    } else {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
    }
    
    0 讨论(0)
提交回复
热议问题