View in English

  • Apple 开发者
    • 入门汇总

    探索“入门汇总”

    • 概览
    • 学习
    • Apple Developer Program

    及时了解最新动态

    • 最新动态
    • 开发者你好
    • 平台

    探索“平台”

    • Apple 平台
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    • App Store

    精选

    • 设计
    • 分发
    • 游戏
    • 配件
    • 网页
    • Home
    • CarPlay 车载
    • 技术

    探索“技术”

    • 概览
    • Xcode
    • Swift
    • SwiftUI

    精选

    • 辅助功能
    • App Intents
    • Apple 智能
    • 游戏
    • 机器学习与 AI
    • 安全性
    • Xcode Cloud
    • 社区

    探索“社区”

    • 概览
    • “与 Apple 会面交流”活动
    • 社区主导的活动
    • 开发者论坛
    • 开源

    精选

    • WWDC
    • Swift Student Challenge
    • 开发者故事
    • App Store 大奖
    • Apple 设计大奖
    • Apple Developer Centers
    • 文档

    探索“文档”

    • 文档库
    • 技术概述
    • 示例代码
    • 《人机界面指南》
    • 视频

    发布说明

    • 精选更新
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • Apple tvOS
    • Xcode
    • 下载

    探索“下载”

    • 所有下载
    • 操作系统
    • 应用程序
    • 设计资源

    精选

    • Xcode
    • TestFlight
    • 字体
    • SF Symbols
    • Icon Composer
    • 支持

    探索“支持”

    • 概览
    • 帮助指南
    • 开发者论坛
    • “反馈助理”
    • 联系我们

    精选

    • 《开发者账户帮助》
    • 《App 审核指南》
    • 《App Store Connect 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

    • 活动
    • 新闻
    • 论坛
    • 示例代码
    • 视频
 

视频

打开菜单 关闭菜单
  • 专题
  • 所有视频
  • 关于

更多视频

  • 简介
  • 概要
  • 转写文稿
  • 代码
  • Apple App 内购买项目的新功能

    了解如何利用 12 个月承诺期的月度订阅,为用户提供更实惠的订阅支付方式,同时巩固长期订阅关系。探索如何使用 App Store Connect、StoreKit API、Xcode 测试以及其他工具,配置并测试这一全新的支付选项。你还将了解优惠代码兑换 API 的改进,以及 App 审核内容提交体验的提升。

    章节

    • 0:01 - Introduction
    • 0:51 - Overview of monthly subscriptions with a 12-month commitment
    • 1:42 - Set up in App Store Connect
    • 2:28 - Merchandise with StoreKit
    • 6:55 - Monitor subscriptions with App Store Server APIs
    • 8:50 - Bundles and Suites
    • 9:26 - Offer code redemption
    • 10:35 - Enhanced submission experience
    • 12:38 - Next steps

    资源

    • In-App Purchase types
    • Managing the life cycle of monthly subscriptions with a 12-month commitment
    • Supporting monthly subscriptions with a 12-month commitment
    • App Store Server Notifications V2
    • Supporting offer codes in your app
    • Implementing a store in your app using the StoreKit API
      • 高清视频
      • 标清视频

    相关视频

    WWDC26

    • 在 App Store Connect 中探索 Retention Messaging

    WWDC24

    • 实现 App Store Offers

    WWDC23

    • 认识 StoreKit 与 SwiftUI
    • StoreKit 2 的新增功能和 Xcode 中的 StoreKit 测试

    WWDC22

    • App Store Connect 的新功能
  • 搜索此视频…

    你好 我是Sam 是StoreKit团队的工程师 App Store提供了 安全可信的交易平台 供全球用户 发现你的App 借助App Store API 你可以向用户 提供数字商品和服务 同时由App Store商务平台 处理交易 以及端到端的支付处理 本视频将介绍新功能 帮助你展示产品 并拓展你的App业务 首先介绍如何扩展 订阅产品的定价选项 然后讨论 优惠码兑换API的更新 最后回顾增强版 App Store Connect提交体验 即将面向App内购买推出 先从订阅定价更新说起 iOS 26.5引入了 12个月承诺期按月订阅 借助这一新定价功能 你可以让用户选择 按月支付年度订阅 计费方案可添加到 新建或现有的 一年期自动续订产品 在App Store Connect中 通过提供预付或按月 两种付款选项 你可以吸引更多用户 让用户选择 最适合自己的计费方案 将App编译到26.5 SDK后 受支持市场的用户 可订阅新计费方案 在运行iOS iPadOS macOS Apple tvOS或visionOS 26.4的设备上 我将通过为SKDemo App 设置新计费方案来演示 此App使用StoreKit 展示并销售App内购买产品 你可以在Resources中 下载示例代码项目 跟随本视频一起操作 我已在App Store Connect 设置好SKDemo App 并导航至订阅部分 我想为用户 提供更实惠的选项 用于SKDemo+订阅 因此选择 一年期订阅产品 在12个月承诺期按月 付款的可用性选项下 选择Set Up Availability 然后按步骤配置计费方案 创建后 可为每种计费 方案类型配置订阅优惠 例如 我仅为以下用户 添加了免费试用 即订阅12个月承诺期的用户

    在App Store Connect中为 SKDemo配置好新订阅定价后 我可以使用StoreKit 向用户展示新付款选项

    PricingTerms是 SubscriptionInfo上的新属性 用于展示计费方案信息 PricingTerms数组列出 该产品所有可用的计费方案 每个自动续订产品在此数组中 至少有一个计费方案 默认billingPlanType 为.upFront 由于我配置了按月订阅 并为SKDemo+ 设置12个月承诺期 PricingTerms数组中 会返回第二个对象 此计费方案的billingPlanType 为.monthly 仅适用于 12个月承诺期按月订阅 在App中展示定价条款 我将使用StoreKit视图 StoreKit视图API负责处理 从App Store加载产品元数据 及调整布局等工作 让你的商店自动适配 在所有平台上都原生呈现 我将展示代码实现方式 首先添加新的 SwiftUI视图修饰器 .preferredSubscriptionPricingTerms 并附加到现有的 SubscriptionStoreView 然后筛选.pricingTerms中 .monthly的.billingPlanType 现在 我的订阅商店已更新 可以展示12个月承诺期 的按月订阅了 如需进一步自定义 SubscriptionStoreView 请观看WWDC23的 Meet StoreKit for SwiftUI 了解StoreKit视图 如何与你的App相匹配 通过自定义图标 背景及其他更改 在App的自定义商店界面 中展示承诺方案 使用Product API获取产品 并筛选.pricingTerms中 .monthly的.billingPlanType 然后获取月度价格和 totalCommitmentPrice显示在界面 注意 计费方案元数据 仅在可用时返回 在用户所在的商店中

    要发起购买 传入新的.billingPlanType 购买选项并处理结果

    用户首次订阅承诺方案前 会展示包含新信息的 披露页面 App Store自动显示此页面 每个Apple账户仅显示一次 页面包含付款期数信息 以完成承诺期 以及取消指引 订阅处于激活状态时 App Store还会自动 为用户提供新界面 以管理12个月承诺期 的按月订阅 在这里 用户可以查看 所有可用方案 并查看剩余付款期数 以及计费承诺期的续订时间 你可以呈现 .manageSubscriptionsSheet 直接在你的App内显示 使用SwiftUI中的 .manageSubscriptionsSheet API 或在UIKit中调用 showManageSubscriptions API

    要在App中获取 当前订阅信息 可使用Transaction上的新字段 获取计费方案专属元数据 对于.upfront billingPlanType 的Transaction commitmentInfo为nil 对于.monthly billingPlanType 的Transaction commitmentInfo返回进度 以及12个月承诺期的 价格和到期时间 你可以使用最新交易中 的这些字段 核查用户权益 或构建自己的 承诺期进度指示器 请始终使用最新交易 以获取准确的expirationDate

    同样 你可以获取 renewalBillingPlanType 以及RenewalInfo上的 commitmentInfo 获取整体承诺期 的续订信息 这些新字段从OS 26.4 开始可用

    为新计费方案添加展示 和解锁内容的逻辑后 可在Xcode中使用 StoreKit Testing开始测试 从Xcode 26.5开始 打开StoreKit配置文件 并选择一年期自动续订产品 然后使用新的 Billing Plan选择器 选择12个月承诺期按月付款 以创建计费方案 这将创建新字段 用于配置定价 用于12个月承诺期 按月订阅 与App Store Connect类似 可在Xcode中为每种计费 方案类型单独创建优惠

    配置后 使用Transaction Manager 测试购买流程 并在Transaction Inspector中 验证commitmentInfo

    要进一步了解在Xcode中设置 StoreKit Testing的最佳实践 请观看WWDC23的《What's new in StoreKit 2 and StoreKit Testing in Xcode》 如果你的App使用App Store Server API 或App Store Server Notifications V2 可以为用户利用新功能 用于12个月承诺期 的按月订阅用户 现有新字段 在已签名的交易 和续订信息对象中 提供有关承诺方案 的更多信息 订阅通知持续提供更新 关于订阅生命周期的 例如12个月承诺期内 的每月续订

    Retention Messaging API 也支持此新付款选项 用于自动续订产品 请观看我们的WWDC26视频 《Explore Retention Messaging in App Store Connect》 了解此服务器到服务器API 如何助力你的用户留存策略 我将展示来自服务器的 交易载荷示例 一次12个月承诺期 的计费周期购买 此解码后的JWSTransaction 包含新字段 与我之前在StoreKit中 介绍的字段对应 使用这些字段 检测计费周期购买 并了解其在整体承诺期 中的位置

    已签名的续订信息对象 包含类似字段 反映用户的续订偏好设置 在当前承诺期结束后 因此 它们仅出现在 续订信息中 当订阅处于承诺期时 在此示例中 用户更改了订阅 以续订为另一个 BILLED_UPFRONT方案 在承诺期结束后

    要进一步了解续订处理 以及12个月承诺期内 的其他事件 请查阅开发者文档 《Managing the life cycle of monthly subscriptions with a 12-month commitment》

    除年度订阅的新定价功能外 我很高兴分享 另一项新功能 以扩展你的订阅产品 Bundle和Suite 提供订阅Bundle和Suite 是另一种方式 可在多个App的订阅中 为用户提供更多价值 我们来看看Bundle 和Suite的区别 Bundle是一组 可单独购买的订阅组合 但作为一次购买捆绑销售 并以更优惠的价格提供 比单独购买所有订阅 更划算

    Suite是一组仅在Suite 场景下存在的订阅 这些订阅无法单独购买 但组合后通常为一组 相关App提供服务 你可以在Xcode 27中 开始测试Bundle和Suite API 更多详情将于2026年稍后公布 下面来谈谈优惠码 优惠码可添加到 消耗型 非消耗型 自动续订或 非续订订阅产品 让你为用户提供免费 或折扣App内购买 在特定时段内 要了解如何在App Store Connect 中配置优惠码 请观看WWDC24的 《Implement App Store Offers》

    用户可直接在你的App内 兑换优惠码 当你使用OfferCodeRedemption API 呈现此页面时 类似于创建购买 API现在 返回verificationResult 在兑换完成时 API还接受一组RedeemOption值 用于配置代码兑换 如果兑换成功 你会在verificationResult中 收到交易对象 如果兑换失败 你会收到描述 失败原因的错误 更新后的兑换API 也提供UIKit版本 通过presentOfferCodeRedeemSheet使用

    你现在可以在Xcode 27中 测试优惠码兑换 使用新兑换API 支持所有适用产品类型

    准备好向App Store 提交App时 可以使用增强版提交体验 用于App Store Connect 中的App内购买 包括将多个产品作为 审核项目分组的功能 在单次App Review提交中 App内购买产品现在可与 其他审核项目结合 包括App内活动 自定义产品页面 以及产品页面优化 提交后 可在App Review中 查看状态 在所有审核项目的 集中视图中 这些改进有助于保持 提交工作流的有序性 并在所有审核项目类型 间保持一致 通过统一提交流程 我将演示增强版 提交流程的示例 使用App Store Connect 中的SKDemo App 当我有App内购买产品 准备提交至App Review时 可通过Add for Review下拉菜单 添加至草稿提交 然后 可查看提交中 的所有审核项目 通过点击进行中的草稿

    要将大批量产品 添加到提交中 我将前往 App内购买产品列表 选择每个需要 一起审核的产品 然后点击Add for Review 并选择进行中的提交

    除App Store Connect网站外 增强版提交体验即将面向 App Store Connect API推出 reviewSubmissions正在扩展 以支持App内购买 订阅 以及订阅组资源 reviewSubmissions API集合 将使你能够 通过单一接口自动执行 所有审核项目的任务

    App内购买的现有资源 订阅和订阅组将被废弃 以支持reviewSubmission和 reviewSubmissionItems资源 请尽快开始迁移

    请观看WWDC22的 《What's New in App Store Connect》 深入了解审核项目机制 以及如何提交至App Review App内购买的这些新功能 为你提供了更多方式 以拓展用户群 并为用户提供更多价值 在结束前 以下是一些后续步骤 首先添加新计费方案 为用户提供按月订阅 的灵活性 同时确保长期承诺 用于你的年度订阅产品 更新App中所有 优惠码兑换调用点 以利用扩展的兑换API 立即在Xcode 27和沙盒中 测试这些新功能 准备好后 提交更新后的 App内购买产品 体验增强版App Review

    感谢你的加入 成为Apple开发者社区的一员 希望这些功能能够推动 你的App内购买 触达更多用户 让你专注于打造 用户喜爱的优秀App和游戏

    • 3:29 - Merchandise pricing terms with StoreKit views

      // Merchandise pricing terms with StoreKit views
      
      import StoreKit
      import SwiftUI
      
      struct SubscriptionStore: View {
          var body: some View {
              SubscriptionStoreView(groupID: "3F19ED53") {
                  // Custom marketing content
              }
              .preferredSubscriptionPricingTerms {_, subscriptionInfo in
                  subscriptionInfo.pricingTerms.first {
                      $0.billingPlanType == .monthly
                  }
              }
          }
      }
    • 4:02 - Get subscription pricing terms and make a purchase

      // Get subscription pricing terms and make a purchase
      
      import StoreKit
      
      var product: Product?
      // Fetch and assign product
      
      // Get the monthly billing plan's pricing terms for merchandising
      let pricingTerms = product?.subscription?.pricingTerms
        .first(where: {$0.billingPlanType == .monthly })
      if let pricingTerms {
        let monthlyPrice = pricingTerms.billingDisplayPrice
        let totalCommitmentPrice = pricingTerms.commitmentInfo.price
        // Display both monthly and total commitment price to the customer
      }
      
      let result = try? await product?.purchase(options: [.billingPlanType(.monthly)])
      switch result {
        // Verify the transaction, give the customer access to
        // the purchased content, and then finish the transaction
      }
    • 5:05 - Sheet to manage subscriptions by subscriptionGroupID

      // Sheet to manage subscriptions by subscriptionGroupID
      
      import SwiftUI
      import StoreKit
      
      struct ManageSubscriptionsButton: View {
          let subscriptionGroupID: String
          @State var presentingManageSubscriptionsSheet: Bool = false
      
          var body: some View {
              Button("Manage Subscriptions") {
                  presentingManageSubscriptionsSheet = true
              }
              .manageSubscriptionsSheet(
                  isPresented: $presentingManageSubscriptionsSheet,
                  subscriptionGroupID: subscriptionGroupID
              )
          }
      }
    • 7:45 - JWSTransaction (decoded) for a monthly subscription with a 12-month commitment

      // JWSTransaction (decoded) for a monthly subscription with a 12-month commitment
      
      {
          // …
          "expiresDate": 1783503660000, // for this billing period
          "price": 10990, // for this billing period
          "productId": "plus.pro.annual",
          "purchaseDate": 1780911660000,
          "type": "Auto-Renewable Subscription",
          "billingPlanType": "MONTHLY",
          "commitmentInfo": {
              "billingPeriodNumber": 1,
              "totalBillingPeriods": 12,
              "commitmentExpiresDate": 1812447660000,
              "commitmentPrice": 131880,
          }
      }
    • 7:59 - JWSRenewalInfo (decoded) for a monthly subscription with a 12-month commitment

      // JWSRenewalInfo (decoded) for a monthly subscription with a 12-month commitment
      
      {
          // … 
          "renewalBillingPlanType": "MONTHLY",
          "commitmentInfo": {
              "commitmentAutoRenewProductId": “plus.standard.annual”,
              "commitmentAutoRenewStatus": 0,
              "commitmentRenewalDate": 1812447660000,
              "commitmentRenewalPrice": 10990,
              "commitmentRenewalBillingPlanType": "BILLED_UPFRONT"
          }
      }
    • 9:58 - Sheet to redeem an offer code

      // Sheet to redeem an offer code
      
      struct OfferCodeRedemption: View {
          @State var presentingOfferCodeSheet: Bool = false
      
          var body: some View {
              Button("Redeem Offer Code") {
                  presentingOfferCodeSheet = true
              }
              .offerCodeRedemption(options: [], isPresented: $presentingOfferCodeSheet) {result in
                  switch result {
                  case .success(let verificationResult):
                      switch verificationResult {
                          // Verify the transaction, give the customer access to
                          // the purchased content, and then finish the transaction
                      }
                  case .failure(let error):
                      // Handle error
                  }
              }
          }
      }
    • 0:01 - Introduction
    • Learn how to merchandise products and grow your business with expanded subscription pricing options, updates to the offer code redemption API, and an enhanced App Store Connect submission experience.

    • 0:51 - Overview of monthly subscriptions with a 12-month commitment
    • Monthly subscriptions with a 12-month commitment is a new pricing option that lets customers pay monthly for an annual subscription; can be added to new or existing one-year subscriptions in App Store Connect to reach a wider customer base.

    • 1:42 - Set up in App Store Connect
    • Configure monthly subscriptions with a 12-month commitment in App Store Connect. Set up pricing, offers, and availability.

    • 2:28 - Merchandise with StoreKit
    • Learn how SKDemo merchandises monthly subscriptions with a 12-month commitment using StoreKit and learn how to test with StoreKit Testing in Xcode.

    • 6:55 - Monitor subscriptions with App Store Server APIs
    • New fields in App Store Server APIs to manage the subscription lifecycle of monthly subscriptions with a 12-month commitment.

    • 8:50 - Bundles and Suites
    • Offering subscription Bundles and Suites is another way to provide customers with more value in their subscriptions across apps.

    • 9:26 - Offer code redemption
    • The offer code redemption API is extended to take in a set of RedeemOption values and returns a VerificationResult.

    • 10:35 - Enhanced submission experience
    • When you’re ready to submit an app to the App Store, you can utilize our enhanced submission experience for In-App Purchases in App Store Connect.

    • 12:38 - Next steps
    • Utilize the new features; adopt the expanded subscription pricing, update offer code redemption call sites, test in Xcode 27 and sandbox, and submit through the enhanced App Review experience.

Developer Footer

  • 视频
  • WWDC26
  • Apple App 内购买项目的新功能
  • 打开菜单 关闭菜单
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    打开菜单 关闭菜单
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    打开菜单 关闭菜单
    • 辅助功能
    • 配件
    • Apple 智能
    • App 扩展
    • App Store
    • 音频与视频 (英文)
    • 增强现实
    • 设计
    • 分发
    • 教育
    • 字体 (英文)
    • 游戏
    • 健康与健身
    • App 内购买项目
    • 本地化
    • 地图与位置
    • 机器学习与 AI
    • 开源资源 (英文)
    • 安全性
    • Safari 浏览器与网页 (英文)
    打开菜单 关闭菜单
    • 完整文档 (英文)
    • 部分主题文档 (简体中文)
    • 教程
    • 下载
    • 论坛 (英文)
    • 视频
    打开菜单 关闭菜单
    • 支持文档
    • 联系我们
    • 错误报告
    • 系统状态 (英文)
    打开菜单 关闭菜单
    • Apple 开发者
    • App Store Connect
    • 证书、标识符和描述文件 (英文)
    • 反馈助理
    打开菜单 关闭菜单
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program (英文)
    • Mini Apps Partner Program
    • News Partner Program (英文)
    • Video Partner Program (英文)
    • 安全赏金计划 (英文)
    • Security Research Device Program (英文)
    打开菜单 关闭菜单
    • 与 Apple 会面交流
    • Apple Developer Center
    • App Store 大奖 (英文)
    • Apple 设计大奖
    • Apple Developer Academies (英文)
    • WWDC
    阅读最近新闻。
    获取 Apple Developer App。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则