2025-12-16 13:10:50 +08:00
|
|
|
|
//
|
|
|
|
|
|
// StoreKitServiceDelegate.swift
|
|
|
|
|
|
// StoreKit2Manager
|
|
|
|
|
|
//
|
|
|
|
|
|
// Created by xiaopin on 2025/12/6.
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
import StoreKit
|
|
|
|
|
|
|
|
|
|
|
|
/// StoreKitService 内部代理协议
|
|
|
|
|
|
/// 所有回调都在主线程执行
|
|
|
|
|
|
@MainActor
|
|
|
|
|
|
internal protocol StoreKitServiceDelegate: AnyObject {
|
|
|
|
|
|
/// 状态更新
|
|
|
|
|
|
func service(_ service: StoreKitService, didUpdateState state: StoreKitState)
|
|
|
|
|
|
|
|
|
|
|
|
/// 产品加载成功
|
|
|
|
|
|
func service(_ service: StoreKitService, didLoadProducts products: [Product])
|
|
|
|
|
|
|
|
|
|
|
|
/// 已购买交易订单更新
|
|
|
|
|
|
func service(_ service: StoreKitService, didUpdatePurchasedTransactions efficient: [Transaction], latests: [Transaction])
|
2025-12-16 15:47:12 +08:00
|
|
|
|
|
|
|
|
|
|
/// 某个交易完成(验证成功)
|
|
|
|
|
|
func service(_ service: StoreKitService, didCompletePurchaseFor productId: String, payload: String)
|
2025-12-16 13:10:50 +08:00
|
|
|
|
}
|