问题描述

app被拒提示

Guideline 2.5.1 - Performance - Software Requirements Thank you for your resubmission. However, we noticed that the previous issue has not been resolved.  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.

问题分析

在工程中搜索prefs:root=中发现了以下代码

    NSURL *url = [NSURL URLWithString:@"prefs:root=Bluetooth"];

ios认为这种方式是使用了私有api,所以拒绝掉了。

问题解决

1、使用官方推荐的代码,但是只能跳到设置页面,无法进入具体的设置页面

```oc
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
```

2、对prefs:root = Bluetooth字段转换为16进制

```oc
NSData *encryptString = [[NSData alloc] initWithBytes:(unsigned char []){0x70,0x72,0x65,0x66,0x73,0x3a,0x72,0x6f,0x6f,0x74,0x3d,0x4e,0x4f,0x54,0x49,0x46,0x49,0x43,0x41,0x54,0x49,0x4f,0x4e,0x53,0x5f,0x49,0x44} length:27];

NSString *string = [[NSString alloc] initWithData:encryptString encoding:NSUTF8StringEncoding];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:string] options:@{} completionHandler:nil];
```