Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

axiom-storekit-ref

БесплатноБез исполняемых скриптовНе проверен

Reference — Complete StoreKit 2 API guide covering Product, Transaction, AppTransaction, RenewalInfo, SubscriptionStatus, StoreKit Views, purchase options…

ComeOnOliverот ComeOnOliver★ 67 звёзд на GitHub

Об этом скилле

StoreKit 2 — Complete API Reference

Overview

StoreKit 2 is Apple's modern in-app purchase framework with async/await APIs, automatic receipt validation, and SwiftUI integration. This reference covers every API, iOS 18.4 enhancements, and comprehensive WWDC 2025 code examples.

Product Types Supported

Consumable:

  • Products that can be purchased multiple times
  • Examples: coins, hints, temporary boosts
  • Do NOT restore on new devices

Non-Consumable:

  • Products purchased once, owned forever
  • Examples: premium features, level packs, remove ads
  • MUST restore on new devices

Auto-Renewable Subscription:

  • Subscriptions that renew automatically
  • Organized into subscription groups
  • MUST restore on new devices
  • Support: free trials, intro offers, promotional offers, win-back offers

Non-Renewing Subscription:

  • Fixed duration subscriptions (no auto-renewal)
  • Examples: seasonal passes
  • MUST restore on new devices

Key Improvements Over StoreKit 1

  • Async/Await: Modern concurrency instead of delegates/closures
  • Automatic Verification: JSON Web Signature (JWS) verification built-in
  • Transaction Types: Strong Swift types instead of SKPaymentTransaction
  • Testing: StoreKit configuration files for local testing
  • SwiftUI Views: Pre-built purchase UIs (ProductView, SubscriptionStoreView)
  • Server APIs: App Store Server API and Server Notifications

When to Use This Reference

Use this reference when:

  • Implementing in-app purchases with StoreKit 2
  • Understanding new iOS 18.4 fields (appTransactionID, offerPeriod, etc.)
  • Looking up specific API signatures and parameters
  • Planning subscription architecture
  • Debugging transaction issues
  • Implementing StoreKit Views
  • Integrating with App Store Server APIs

Related Skills:

  • axiom-in-app-purchases — Discipline skill with testing-first workflow, architecture patterns
  • (Future: iap-auditor agent for auditing existing IAP code)
  • (Future: iap-implementation agent for implementing IAP from scratch)

Product

Overview

Product represents an in-app purchase item configured in App Store Connect or StoreKit configuration file.

Loading Products

Basic Loading:

import StoreKit

let productIDs = [
    "com.app.coins_100",
    "com.app.premium",
    "com.app.pro_monthly"
]

let products = try await Product.products(for: productIDs)

From WWDC 2021-10114

Handling Missing Products:

let products = try await Product.products(for: productIDs)

// Check what loaded
let loadedIDs = Set(products.map { $0.id })
let missingIDs = Set(productIDs).subtracting(loadedIDs)

if !missingIDs.isEmpty {
    print("Missing products: \(missingIDs)")
    // Products not configured in App Store Connect or .storekit file
}

Product Properties

Basic Properties:

let product: Product

product.id // "com.app.premium"
product.displayName // "Premium Upgrade"
product.description // "Unlock all features"
product.displayPrice // "$4.99"
product.price // Decimal(4.99)
product.type // .nonConsumable

Product Type Enum:

switch product.type {
case .consumable:
    // Coins, hints, boosts
case .nonConsumable:
    // Premium features, level packs
case .autoRenewable:
    // Monthly/annual subscriptions
case .nonRenewing:
    // Seasonal passes
@unknown default:
    break
}

Subscription-Specific Properties

Check if Product is Subscription:

if let subscriptionInfo = product.subscription {
    // Product is auto-renewable subscription
    let groupID = subscriptionInfo.subscriptionGroupID
    let period = subscriptionInfo.subscriptionPeriod
}

Subscription Period:

let period = product.subscription?.subscriptionPeriod

switch period?.unit {
case .day:
    print("\(period?.value ?? 0) days")
case .week:
    print("\(period?.value ?? 0) weeks")
case .month:
    print("\(period?.value ?? 0) months")
case .year:
    print("\(period?.value ?? 0) years")
default:
    break
}

Introductory Offer:

if let introOffer = product.subscription?.introductoryOffer {
    print("Free trial: \(introOffer.period.value) \(introOffer.period.unit)")
    print("Price: \(introOffer.displayPrice)")

    switch introOffer.paymentMode {
    case .freeTrial:
        print("Free trial - no charge")
    case .payAsYouGo:
        print("Discounted price per period")
    case .payUpFront:
        print("One-time discounted price")
    @unknown default:
        break
    }
}

Promotional Offers:

let offers = product.subscription?.promotionalOffers ?? []

for offer in offers {
    print("Offer ID: \(offer.id)")
    print("Price: \(offer.displayPrice)")
    print("Period: \(offer.period.value) \(offer.period.unit)")
}

Purchase Methods

Purchase with UI Context (iOS 18.2+):

let product: Product
let scene: UIWindowScene

let result = try await product.purchase(confirmIn: scene)

From

Полный SKILL.md на GitHub

Установить axiom-storekit-ref в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл axiom-storekit-ref?

Reference — Complete StoreKit 2 API guide covering Product, Transaction, AppTransaction, RenewalInfo, SubscriptionStatus, StoreKit Views, purchase options, server APIs, and all iOS 18.4 enhancements with WWDC 2025 code examples

Как установить скилл axiom-storekit-ref?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл axiom-storekit-ref запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить axiom-storekit-ref с