iOS 应用跳到系统设置-canOpenURL: failed for URL: "prefs:root=WIFI" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

1.iOS < 10

1)添加URL
2BF1D3EA-41F4-4A20-9658-1EB89C750EA9.png

2)跳转
NSURL *url = [NSURL URLWithString:@"prefs:root=WIFI"];
if ([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url];
}

2.iOS >= 10
用上面的方法会报错
-canOpenURL: failed for URL: "prefs:root=WIFI" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
只允许调到自己项目的设置页面:
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


iOS 应用跳到系统设置-canOpenURL: failed for URL:
IMG_0096.PNG

你可能感兴趣的:(iOS 应用跳到系统设置-canOpenURL: failed for URL: "prefs:root=WIFI" - error: "The operation couldn’t be completed. (OSStatus error -10814.)")