提交AppStore机器审核被拒以及解决方案 Missing Purpose String in Info.plist

本文针对iOS应用在App Store上架时遇到的权限审核问题,提供了详细的解决方案。包括如何正确设置Info.plist文件中的权限描述、如何处理第三方库带来的权限问题以及Flutter应用中的权限管理技巧。

作为iOS开发,我们都知道app的审核上架都要经过机审和人审,那么如果被坑到了机审,就会觉得自己怎么可能会导致不久卡到?作这么久的开发,机审这些硬性的要求竟然还有自己不知道的?哈哈。

其实追其原因,都是一些马虎大意造成的。又或者是一些三方库内部使用的为对外开放。“坑”了你。

那么硬性要求大家遇到最多的就是权限问题:(尤其最近安卓机某些app频发的随意访问你的通讯录,相册,摄像头等,国家也开始对app的监管,苹果这边本来做的还可以,现在也更严格了)

下面就是一封提交被机审拒掉的邮件:

Dear Developer,

We identified one or more issues with a recent delivery for your app, “APP名称” 1.0.0 (1.0.0.6). Please correct the following issues, then upload again.

ITMS-90683: Missing Purpose String in Info.plist - Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSContactsUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn’t contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

ITMS-90683: Missing Purpose String in Info.plist - Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSCalendarsUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data.
### 问题分析 在 iOS 应用中使用 Google Sign-In 或 Firebase Authentication 等服务时,若未正确配置 `GIDClientID`,会出现提示 `No active configuration. GIDClientID not set in Info.plist`。该错误表明应用缺少必要的客户端 ID 配置信息,导致身份验证流程无法启动。 iOS 应用通常通过 `Info.plist` 文件注册与 Google 相关的服务配置,包括 OAuth 客户端 ID 和 URL Scheme。如果此文件中缺失 `GIDClientID` 键值对,则 SDK 无法初始化认证上下文,从而抛出上述错误[^2]。 --- ### 解决方案 #### 在 Google Cloud Console 获取客户端 ID 前往 [Google Cloud Console](https://console.cloud.google.com/),选择对应项目,在“凭证”页面中找到适用于 iOS 的 OAuth 客户端 ID。复制该 ID 用于后续配置步骤。 #### 手动编辑 Info.plist 添加 GIDClientID 打开 Xcode 工程中的 `Info.plist` 文件,添加一个新的键值对: ```xml <key>GIDClientID</key> <string>YOUR_IOS_CLIENT_ID</string> ``` 将 `YOUR_IOS_CLIENT_ID` 替换为从 Google 控制台获取的客户端 ID。确保拼写无误,且键名大小写一致。 #### 验证 URL Types 配置 检查 `Info.plist` 中是否已正确配置 `URL Types`,包含 `CFBundleURLSchemes` 子项,其值应为 `com.googleusercontent.apps.YOUR_CLIENT_ID` 格式。例如: ```xml <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>com.example.app</string> <key>CFBundleURLSchemes</key> <array> <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</string> </array> </dict> </array> ``` 该配置确保应用能够接收并处理来自 Google Sign-In 的回调请求。 #### 使用 GoogleService-Info.plist(如使用 Firebase) 若项目集成 Firebase,则应将 `GoogleService-Info.plist` 文件导入 Xcode 工程,并确保在代码中调用 `FirebaseApp.configure()` 初始化 Firebase SDK。该文件会自动注入必要的配置参数,包括 `GIDClientID`。 #### 检查构建配置与环境变量 确认当前构建目标使用正确的 scheme 和 build configuration。某些项目可能在不同环境中定义不同的 `Info.plist` 文件或预处理器宏,需确保所选配置指向包含 `GIDClientID` 的正确 plist 资源。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值