Shared interface implemented by both the SK1 and SK2 bridges. The adapter programs against this interface, not a concrete class.

Implements

Constructors

Properties

appStoreReceipt?: null | ApplicationReceipt

Cached app store receipt

isSK2: true = true

True when this bridge is active (SK2 extension installed + iOS 15+)

pendingTransactionsReady?: Promise<void>

Resolves when pending transactions from the native queue have been processed

transactionsForProduct: {
    [productId: string]: string[];
} = {}

Transaction IDs grouped by product

Type declaration

  • [productId: string]: string[]

Methods

  • Parameters

    • success: (() => void)
        • (): void
        • Returns void

    • error: ((message) => void)
        • (message): void
        • Parameters

          • message: string

          Returns void

    Returns void

  • Returns void

  • Parameters

    • transactionId: string
    • success: (() => void)
        • (): void
        • Returns void

    • error: ((msg) => void)
        • (msg): void
        • Parameters

          • msg: string

          Returns void

    Returns void

  • Retrieve the storefront country code from StoreKit

    Returns Promise<undefined | string>

  • Parameters

    • options: Partial<BridgeOptions>
    • success: (() => void)
        • (): void
        • Returns void

    • error: ((code, message) => void)

    Returns void

  • Returns void

  • Parameters

    • productIds: string[]
    • success: ((validProducts, invalidProductIds) => void)
        • (validProducts, invalidProductIds): void
        • Parameters

          Returns void

    • error: ((code, message) => void)

    Returns void

  • Returns void

  • Parameters

    • productId: string
    • quantity: number
    • applicationUsername: undefined | string
    • discount: undefined | PaymentDiscount
    • success: (() => void)
        • (): void
        • Returns void

    • error: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Called from native. Same as SK1 but with extra SK2 fields.

    Parameters

    • state: CdvPurchase.AppleAppStore.Bridge.TransactionState
    • errorCode: undefined | CdvPurchase.ErrorCode
    • errorText: undefined | string
    • transactionIdentifier: string
    • productId: string
    • transactionReceipt: never
    • originalTransactionIdentifier: undefined | string
    • transactionDate: undefined | string
    • discountId: undefined | string
    • Optional expirationDate: string
    • Optional jwsRepresentation: string
    • Optional quantity: number

    Returns void

  • Check if the SK2 extension plugin is installed

    Returns boolean