目录

App Store 审核被拒指南:Guideline 2.1 PassKit/Apple Pay 问题修复

在 iOS 应用提交 App Store 审核的过程中,开发者经常会遇到各种各样的拒稿理由。其中,Guideline 2.1 相关的拒稿通常涉及到元数据或功能完整性的问题。

近期,在提交一个使用 StoreKit 2 进行订阅的应用时,遇到了因 PassKit (Apple Pay) 相关的拒稿。本文将详细记录这一问题的现象、原因分析以及最终的修复方案,希望能帮助遇到同样问题的开发者。

1. 问题描述

在提交应用审核后,收到了来自 Apple 审核团队的如下反馈:

Guideline 2.1 - Information Needed

The app binary includes the PassKit framework for implementing Apple Pay, but we were unable to verify any integration of Apple Pay within the app.

Next Steps

If the app integrates the functionality referenced above, indicate where in the app we can locate it.

If the app does not include this functionality, indicate this information in the Review Notes section for each version of the app in App Store Connect when submitting for review.

解读

审核员检测到应用的二进制文件(Binary)中包含了 PassKit 框架(通常用于 Apple Pay),但在 App 内部却没有找到任何使用 Apple Pay 的功能入口。Apple 要求我们要么指明功能位置,要么解释为何包含了该框架却不使用。

2. 根本原因分析

2.1 问题定位

接到拒稿后,我对项目进行了详细的排查:

  1. 代码层面:搜索全工程,确认项目中并没有 import PassKit,也没有任何处理 Apple Pay 支付请求的代码。
  2. 功能层面:应用使用的是 StoreKit 2 进行数字商品的订阅(In-App Purchase),这与用于实体商品支付的 Apple Pay 是两套完全不同的系统。
  3. 配置层面:检查 .entitlements 文件时,发现了问题所在。

2.2 错误配置

在项目的 entitlements 文件(mementoDebug.entitlementsmementoRelease.entitlements)中,发现了以下配置:

<key>com.apple.developer.in-app-payments</key>
<array/>

2.3 技术辨析

这里存在一个常见的概念混淆:

  • StoreKit (In-App Purchase): 用于销售虚拟商品(如会员订阅、游戏币)。不需要特殊的 Entitlements 权限,直接使用 StoreKit 框架即可。
  • Apple Pay (PassKit): 用于销售实体商品或服务(如电商购物、打车)。必须在 Entitlements 中包含 com.apple.developer.in-app-payments 权限。

结论:由于项目中错误地保留了 Apple Pay 的 Entitlement 权限,导致 Xcode 在构建时自动链接了 PassKit 框架,从而触发了审核员的检测机制。

3. 修复方案

修复的核心在于移除不必要的权限配置,并确保 Release 环境配置正确。

步骤 1:删除 Apple Pay Entitlement

打开项目中的 .entitlements 文件(通常有 Debug 和 Release 两个版本),找到并删除 com.apple.developer.in-app-payments 键值对。

受影响文件:

  • memento/mementoDebug.entitlements
  • memento/mementoRelease.entitlements

步骤 2:检查推送环境配置 (可选)

在检查 Entitlements 时,建议顺带检查推送通知的配置。Release 环境应确保使用 production 环境。

mementoRelease.entitlements 示例:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>aps-environment</key>
    <string>production</string>
    <key>com.apple.developer.applesignin</key>
    <array>
        <string>Default</string>
    </array>
</dict>
</plist>

步骤 3:Xcode 项目配置检查

在重新打包前,请在 Xcode 中进行最后确认:

  1. 进入 Target -> Signing & Capabilities
  2. 确保列表中没有 “Apple Pay”。
  3. 确保只保留了实际使用的能力,例如 “In-App Purchase” (StoreKit)、“Sign in with Apple”、“Push Notifications” 等。

步骤 4:清理并重新构建

  1. 在 Xcode 中执行 Product -> Clean Build Folder (Cmd + Shift + K)。
  2. 重新 Archive 打包上传。

4. 提交审核建议

为了确保审核顺利通过,建议在 App Store Connect 提交新版本时,在 Review Notes (审核备注) 中主动说明情况。

参考文案:

Dear Review Team,

Regarding the previous Guideline 2.1 issue:

This app uses StoreKit 2 for in-app subscriptions (digital goods) and does NOT use Apple Pay.
We have removed the 'com.apple.developer.in-app-payments' entitlement from the project configuration.
The app binary should no longer include the PassKit framework references related to Apple Pay.

Subscription features can be found in: Settings -> Subscription.

5. 总结

这次拒稿经历提醒我们,在 iOS 开发中,Entitlements 文件的管理非常重要。不要申请未使用的权限,这不仅会增加应用体积,引入不必要的框架依赖,还会引发审核团队的质疑。

Checklist:

  • 确认未使用 PassKit 代码。
  • 移除 entitlements 中的 com.apple.developer.in-app-payments
  • 确认 Signing & Capabilities 中无 Apple Pay。
  • Clean Build 后重新打包。