提供商品

プランProduct ID
月額com.happyboy1002.StudyStopwatch.premium.monthly
年額com.happyboy1002.StudyStopwatch.premium.yearly

SubscriptionManager API

final class SubscriptionManager: ObservableObject {
    @Published var products: [Product]
    @Published var isPremium: Bool

    func loadProducts() async
    func purchase(_ product: Product) async throws
    func restorePurchases() async throws
    func startTransactionListener()
}

プレミアム特典

処理フロー

  1. Product.products(for:) で商品取得
  2. 購入時 product.purchase()
  3. 結果を checkVerified() で検証
  4. 成功 → transaction.finish()
  5. Transaction.updates 監視で自動更新も処理

外部連携

連携先用途
StoreKit 2商品取得・購入・トランザクション監視
App Store Connect商品設定・価格

変更履歴

バージョン日付変更内容
1.02026-05-09初版作成