Guideline 2.5.1 - Performance - Software Requirements Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store. Next Steps To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL scheme. If there are no alternatives for providing the functionality your app requires, you can file an enhancement request. Since your App Store Connect status is Rejected, a new binary will be required.
/** 判断网络状态 @return <#return value description#> */ - (BOOL)judgeNetStatus{ [SVProgressHUD setMinimumDismissTimeInterval:2]; AppDelegate * appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; if ([appDelegate.network isEqualToString:NETUnknownSign] || [appDelegate.network isEqualToString:NETNoSign]) { // [SVProgressHUD setMinimumDismissTimeInterval:2]; // [SVProgressHUD showInfoWithStatus:@"无网络信号,请检查网络设置!"]; NSURL *url = [NSURL URLWithString:@"App-Prefs:root=MOBILE_DATA_SETTINGS_ID"]; // NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; NSString *app_Name = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]; UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"请容许网络访问" message:[NSString stringWithFormat:@"请在系统的设置-%@-无线数据",app_Name] preferredStyle:UIAlertControllerStyleAlert]; if([[UIApplication sharedApplication] canOpenURL:url]) { [alertController addAction:[UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) { }]; }]]; [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action){ }]]; }else{ [alertController addAction:[UIAlertAction actionWithTitle:@"我知道了" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action){ }]]; } [self presentViewController:alertController animated:YES completion:nil]; // NSURL*url=[NSURL URLWithString:@"Prefs:root=Privacy&path=LOCATION"]; // // // !!!关键代码!!!跟以前的写法也不同了!!! // Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace"); // [[LSApplicationWorkspace performSelector:@selector(defaultWorkspace)] performSelector:@selector(openSensitiveURL:withOptions:) withObject:url withObject:nil]; // 1 return NO; } return YES; }
app里面代码调用了私有库:api
将相似这段私有api [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]]; NSURL *url = [NSURL URLWithString:@"App-Prefs:root=MOBILE_DATA_SETTINGS_ID"]; NSURL *url = [NSURL URLWithString:@"APP-Prefs:root=WIFI"]; 换成下面的 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
附:网络
iOS 10 跳转系统设置的字段 电池电量 Prefs:root=BATTERY_USAGE 通用设置 Prefs:root=General 存储空间 Prefs:root=General&path=STORAGE_ICLOUD_USAGE/DEVICE_STORAGE 蜂窝数据 Prefs:root=MOBILE_DATA_SETTINGS_ID Wi-Fi 设置 Prefs:root=WIFI 蓝牙设置 Prefs:root=Bluetooth 定位设置 Prefs:root=Privacy&path=LOCATION 辅助功能 Prefs:root=General&path=ACCESSIBILITY 关于手机 Prefs:root=General&path=About 键盘设置 Prefs:root=General&path=Keyboard 显示设置 Prefs:root=DISPLAY 声音设置 Prefs:root=Sounds App Store 设置 Prefs:root=STORE 墙纸设置 Prefs:root=Wallpaper 打开电话 Mobilephone:// 世界时钟 Clock-worldclock:// 闹钟 Clock-alarm:// 秒表 Clock-stopwatch:// 倒计时 Clock-timer:// 打开相册 Photos:// /* *********************** 此方法APP审核会被拒*********************** */
苹果的要求是不能够再使用prefs:root以及App-Prefs:root的接口来作app内部和系统设置的跳转了。如今作app系统设置跳转,官方的只能使用UIApplicationOpenSettingURLString.app
而且,明确一点,就是打开url的api也是须要作适配的。ide
if ([UIDevice currentDevice].systemVersion.floatValue > 10.0) { if( [[UIApplication sharedApplication] canOpenURL:url] ) { [[UIApplication sharedApplication] openURL:url options:@{}completionHandler:^(BOOL success) { }]; } }else{ NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; if( [[UIApplication sharedApplication] canOpenURL:url] ) { [[UIApplication sharedApplication] openURL:url options:@{}completionHandler:^(BOOL success) { }]; } }
最后一点:测试
一些网站上说使用prefs:root配合在info.plist上加入URL scheme值为prefs:的方案能够解决这个上架被拒的问题。可是通过我本身的测试,如今“prefs:root”是苹果不容许的,并且这个在info.plist中加入URL scheme值为prefs:也是不能够的。网站
也就是说使用“prefs:root”作跳转 以及 在info.plist中加入URL scheme值为prefs:,这二者,只要存在其中一项都会被app store拒绝的。ui
把本来在info.plist中的prefs去掉以后,就上架成功了!this
当前iOS10/9支持的全部跳转,亲测可用(测试系统:10.2.1 9.3.2)url
跳转 | 写法 |
无线局域网 | App-Prefs:root=WIFI |
蓝牙 | App-Prefs:root=Bluetooth |
蜂窝移动网络 | App-Prefs:root=MOBILE_DATA_SETTINGS_ID |
我的热点 | App-Prefs:root=INTERNET_TETHERING |
运营商 | App-Prefs:root=Carrier |
通知 | App-Prefs:root=NOTIFICATIONS_ID |
通用 | App-Prefs:root=General |
通用-关于本机 | App-Prefs:root=General&path=About |
通用-键盘 | App-Prefs:root=General&path=Keyboard |
通用-辅助功能 | App-Prefs:root=General&path=ACCESSIBILITY |
通用-语言与地区 | App-Prefs:root=General&path=INTERNATIONAL |
通用-还原 | App-Prefs:root=Reset |
墙纸 | App-Prefs:root=Wallpaper |
Siri | App-Prefs:root=SIRI |
隐私 | App-Prefs:root=Privacy |
Safari | App-Prefs:root=SAFARI |
音乐 | App-Prefs:root=MUSIC |
音乐-均衡器 | App-Prefs:root=MUSIC&path=com.apple.Music:EQ |
照片与相机 | App-Prefs:root=Photos |
FaceTime | App-Prefs:root=FACETIME |