系统: Mac OS 10.15.1, XCode 11.3,swift 5.0
写作时间:2019-12-23

说明

苹果私有API调用,导致审核失败。
错误代码

// swift
UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General")!)// objc
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]];

word of warning: the prefs:root or App-Prefs:root URL schemes are considered private API. Apple may reject you app if you use those, here is what you may get when submitting your app:

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.

解决

一句话swift解决

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)

swift 5 举个完整栗子

 override func viewDidAppear(_ animated: Bool) {let alertController = UIAlertController (title: "Title", message: "Go to Settings?", preferredStyle: .alert)let settingsAction = UIAlertAction(title: "Settings", style: .default) { (_) -> Void inguard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {return}if UIApplication.shared.canOpenURL(settingsUrl) {UIApplication.shared.open(settingsUrl, completionHandler: { (success) inprint("Settings opened: \(success)") // Prints true})}}alertController.addAction(settingsAction)let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: nil)alertController.addAction(cancelAction)present(alertController, animated: true, completion: nil)
}

参考

https://stackoverflow.com/questions/28152526/how-do-i-open-phone-settings-when-a-button-is-clicked

私有api调用审核失败 prefs:root相关推荐

  1. class-dump导出iOS系统私有库以及简单的私有API调用

    前言 This is a command-line utility for examining the Objective-C runtim information stored in Mach-O ...

  2. iOS私有API检测扫描思路以及工具开发(Python3 + Django)

    不足之处 1.class-dump有些文件会报错,由于只支持OC runtime的方式获取,可执行文件是c或者swift都无法被dump 2.私有api在公开的Framework及私有的Private ...

  3. 数据对齐问题引发的API调用失败

    数据对齐问题引发的Win64 API调用失败 在Win32中,数据对齐并不是很严格,但在Win64中对数据对齐有严格的要求,若不符合要求,则调用API将失败.以下通过3个例子来说明一些容易忽视的问题. ...

  4. 分析appstore审核失败的真实案例及解决办法

    分析AppStore审核失败的真实案例及解决办法 App中设计的图标与Apple原生图标类似,Apple原生图标有专利保护,并且在Design Guideline里面规定,App的图标不能与Apple ...

  5. iOS私有Api检测

    个人原文博客地址: iOS私有Api检测 最近提交APP审核被苹果的审核人员是虐的不要不要的, 一直都说是使用了私有API 但是我使出了浑身解数, 也没找到自己写的代码里哪里用到了私有API, 最后网 ...

  6. ios中通过调试来使用私有api

    转自:http://blog.csdn.net/cubepeng/article/details/11284173 OS不允许使用ios私有api,使用私有api可以获得意想不到的效果 ,同时使用私有 ...

  7. 基于Python2.7的阿里云API调用及运维相关

    基于Python2.7的阿里云API调用及运维相关 http://blog.chinaunix.net/uid-17291169-id-5212576.html 公司部分业务放在阿里云上面,虽然阿里云 ...

  8. Java / Tensorflow - API 调用 pb 模型使用 GPU 推理

    目录 一.引言 二.Java / Tensorflow 代码配置 1.代码配置 2.Maven 配置 三.环境检测 1.显卡检测 2.显卡监控 四.推理踩坑 1.异常现象 2.异常日志 五.安装 cu ...

  9. iOS开发者遇到审核失败的原因及解决办法

    App中设计的图标与Apple原生图标类似,Apple原生图标有专利保护,并且在Design Guideline里面规定,App的图标不能与Apple图标雷同,如iTunes,App Store, i ...

  10. 微信内容安全api调用

    使用背景描述 微信小程序很多需要展示出来的文本,图片,视频等,都需要接入微信内容安全api来做合法校验,如果这些相关功能没有接入微信内容安全api的话,那么小程序审核就会被打回. 解决方法 新建一个W ...

最新文章

  1. 检查SELECTION-SCREEN 上面输入的参数是否合适
  2. 77 行代码实现 ABAP ALV 中的双击事件处理
  3. Oracle 12.2 新特性 | PDB不同字符集变更深入解析
  4. GeoServer不同服务器安装配置、数据发布及客户端访问
  5. UVa 10325 - The Lottery
  6. 可视化排班管理_呼叫中心外包之管理要点与数据分析对策
  7. oracle毕业论文题目,2012届本科毕业论文设计题目参考
  8. 平面设计好学吗?没有基础学平面设计难吗?
  9. PDF文件阅读器可转word...
  10. KODI(XBMC)-基于树莓派的媒体中心使用-Libreelec
  11. Oracle drop table
  12. 从裸机到嵌入式Linux—总纲
  13. uniApp_canvas电子签字
  14. python爬取千图网图片(出现HTTP Error 403怎么解决)
  15. 思维为何会越来越原地踏步No.209
  16. Python--自动将文件分类归入文件夹
  17. 几何光学学习笔记(18)- 5.1光阑在光学系统中的作用
  18. bugku never give up
  19. 川土微电子 | 如何隔离 RS-485 系统
  20. word 公式等号对齐和编号居右

热门文章

  1. 【转】C#中Json和类的相互转化
  2. iOS开发UI篇--仿射变换(CGAffineTransform)使用小结
  3. Redis 之 简单备份还原
  4. 《数据结构与抽象:Java语言描述(原书第4版)》一第2章
  5. PowerShell 使用当前日期创建文件夹
  6. AndroidStudio与eclipse打包的时候报错。Error:(4) Error: ssdk_instapager_login_html is not translated in......
  7. springmvc(2)Controller源码简单解析
  8. 开源日志系统log4cplus(五)
  9. 几个开源项目实体层实现方式比较
  10. android崩解日志,android – 使用rxJava2和改造的UndeliverableException