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 |