type
status
date
slug
summary
tags
category
icon
password
创建 StoreKit Configuration 文件用于本地测试内购功能。
确认了产品 ID:
  • SpeechNote.Membership.Monthly - 月度会员
  • SpeechNote.Membership.Yearly - 年度会员
  • SpeechNote.Membership.Lifetime - 终身会员
现在创建 StoreKit Configuration 文件。
Products.storekit:
产品配置包含:
产品
Product ID
类型
价格
月度会员
SpeechNote.Membership.Monthly
自动续订订阅
¥18/月
年度会员
SpeechNote.Membership.Yearly
自动续订订阅
¥128/年
终身会员
SpeechNote.Membership.Lifetime
非消耗型
¥298
额外配置:
  • 订阅组:SpeechNote Membership
  • 月度会员:3天免费试用
  • 年度会员:1周免费试用
  • 中英文本地化支持
  • Storefront 设置为中国区 (CHN)

在 Xcode 中启用

  1. 打开 Scheme 配置
      • 菜单:ProductSchemeEdit Scheme...(或按 ⌘ + <
  1. 设置 StoreKit Configuration
      • 左侧选择 Run
      • 点击 Options 标签
      • StoreKit Configuration 下拉菜单中选择 Products.storekit
  1. 运行测试

测试功能

运行应用后,可以通过 Xcode 菜单测试各种场景:
菜单路径
功能
DebugStoreKitManage Transactions
查看/管理测试交易
DebugStoreKitTime Rate
加速订阅时间(1秒=1天等)
DebugStoreKitSubscription Renewal Rate
控制续订频率
DebugStoreKitDelete All Transactions
清除所有测试交易
常用测试场景:
  • 正常购买流程
  • 订阅续订/过期
  • 恢复购买
  • 退款(在 Manage Transactions 中操作)
  • 购买失败(可在 .storekit 文件设置中启用错误模拟)
notion image

真机测试会员订阅示例:

notion image
notion image
notion image