苹果审核—–Your app uses the “prefs:root=” non-public URL scheme

苹果错误:

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.

好不容易上个包,却被苹果拒接!

它说,我调用了它的私有接口!

我的解决方法:

NSData *encryptString2 = [[NSData alloc] initWithBytes:(unsigned char []){0x41,0x70,0x70,0x2d,0x50,0x72,0x65,0x66,0x73,0x3a,0x72,0x6f,0x6f,0x74,0x3d,0x57,0x49,0x46,0x49} length:19];
            NSData *encryptString1 = [[NSData alloc] initWithBytes:(unsigned char []){0x70,0x72,0x65,0x66,0x73,0x3a,0x72,0x6f,0x6f,0x74,0x3d,0x57,0x49,0x46,0x49} length:15];
            NSString *string1 = [[NSString alloc] initWithData:encryptString1 encoding:NSUTF8StringEncoding];
            NSString *string2 = [[NSString alloc] initWithData:encryptString2 encoding:NSUTF8StringEncoding];
            if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:string1]]) {
                            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string1]];
                        } else {
                            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string2]];
                        }

就是原本的prefs:root=WIFI 和 App-Prefs:root=WIFI转换成16进制的字符!然后再转回来!绕个道!

用到prefs:root还有好多的配置,我想同样的方法还是可以骗过苹果的。。

下面是一个字符转换的网站:

http://www.bejson.com/convert/ox2str/

 

最后,还是被苹果发现了

无奈项目急于发布,修改成跳转设置页面来通过审核,后面再尝试其它字符编译再续!!

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
   if ([[UIApplication sharedApplication] canOpenURL:url]) {
       [[UIApplication sharedApplication] openURL:url];
   }

2018年10月24日

看到有人分享个APP内部连接WiFi的功能!(亲测有效)

就是打开hotspot,然后程序内设置连接参数和请求!

具体的描述和作者在这里:https://www.jianshu.com/p/376262eb9079

亲测代码:

if (@available(iOS 11.0, *)) {
//参数   ssID:wifi网络名字   password:网络密码     WEP:指定WEP Wi-Fi 网络(接口说明)

        NEHotspotConfiguration * hotspotConfig = [[NEHotspotConfiguration alloc] initWithSSID:@"ssID" passphrase:@"password" isWEP:NO];
        // 开始连接 (调用此方法后系统会自动弹窗确认)
        [[NEHotspotConfigurationManager sharedManager] applyConfiguration:hotspotConfig completionHandler:^(NSError * _Nullable error) {
            NSLog(@"%@",error);
            if (error && error.code != 13 && error.code != 7) {
            }else if(error.code ==7){//error code = 7 :用户点击了弹框取消按钮
            }else{// error code = 13 :已连接
            }
        }];
    } else {
        // iOS11以下版本逻辑
    }

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注