Skip to main content

IapIosSk2

react-native-iap / Exports / IapIosSk2

Namespace: IapIosSk2

Table of contents

Interfaces

Type Aliases

Functions

Type Aliases

BuyProduct

Ƭ BuyProduct: (sku: Sku, andDangerouslyFinishTransactionAutomaticallyIOS: boolean, applicationUsername: string | undefined, quantity: number, withOffer: Record\<keyof PaymentDiscountSk2, string> | undefined) => Promise\<TransactionSk2>

Type declaration

▸ (sku, andDangerouslyFinishTransactionAutomaticallyIOS, applicationUsername, quantity, withOffer): Promise\<TransactionSk2>

Parameters
NameType
skuSku
andDangerouslyFinishTransactionAutomaticallyIOSboolean
applicationUsernamestring | undefined
quantitynumber
withOfferRecord\<keyof PaymentDiscountSk2, string> | undefined
Returns

Promise\<TransactionSk2>

Defined in

modules/iosSk2.ts:22

Functions

beginRefundRequest

beginRefundRequest(sku): Promise\<RefundRequestStatus>

Parameters

NameType
skustring

Returns

Promise\<RefundRequestStatus>

Defined in

modules/iosSk2.ts:108


currentEntitlement

currentEntitlement(sku): Promise\<TransactionSk2>

Parameters

NameType
skustring

Returns

Promise\<TransactionSk2>

Defined in

modules/iosSk2.ts:96


finishTransaction

finishTransaction(transactionIdentifier): Promise\<Boolean>

Parameters

NameType
transactionIdentifierstring

Returns

Promise\<Boolean>

Defined in

modules/iosSk2.ts:120


getReceiptIos

getReceiptIos(): Promise\<string>

Get the receipt data from the iOS device. This returns the base64 encoded receipt data which can be sent to your server for verification with Apple's server.

NOTE: For proper security, always verify receipts on your server using Apple's verifyReceipt endpoint, not directly from the app.

Returns

Promise\<string>

Base64 encoded receipt data

Defined in

modules/iosSk2.ts:134


getTransactionJws

getTransactionJws(sku): Promise\<string>

Get the JWS representation of a purchase for server-side verification. The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.

Parameters

NameTypeDescription
skustringThe product's SKU (on iOS)

Returns

Promise\<string>

JWS representation of the transaction

Defined in

modules/iosSk2.ts:154


isEligibleForIntroOffer

isEligibleForIntroOffer(groupID): Promise\<Boolean>

Parameters

NameType
groupIDstring

Returns

Promise\<Boolean>

Defined in

modules/iosSk2.ts:83


isTransactionVerified

isTransactionVerified(sku): Promise\<boolean>

Check if a transaction is verified through StoreKit 2. StoreKit 2 performs local verification of transaction JWS signatures.

Parameters

NameTypeDescription
skustringThe product's SKU (on iOS)

Returns

Promise\<boolean>

True if the transaction is verified

Defined in

modules/iosSk2.ts:144


latestTransaction

latestTransaction(sku): Promise\<TransactionSk2>

Parameters

NameType
skustring

Returns

Promise\<TransactionSk2>

Defined in

modules/iosSk2.ts:102


showManageSubscriptions

showManageSubscriptions(): Promise\<null>

Returns

Promise\<null>

Defined in

modules/iosSk2.ts:114


subscriptionStatus

subscriptionStatus(sku): Promise\<ProductStatus[]>

Parameters

NameType
skustring

Returns

Promise\<ProductStatus[]>

Defined in

modules/iosSk2.ts:90


sync

sync(): Promise\<null>

Sync state with Appstore (iOS only) https://developer.apple.com/documentation/storekit/appstore/3791906-sync

Returns

Promise\<null>

Defined in

modules/iosSk2.ts:78


validateReceiptIos

validateReceiptIos(sku): Promise\<{ isValid: boolean ; jwsRepresentation: string ; latestTransaction?: TransactionSk2 ; receiptData: string }>

Validate receipt for iOS using StoreKit 2's built-in verification. Returns receipt data and verification information to help with server-side validation.

NOTE: For proper security, Apple recommends verifying receipts on your server using the verifyReceipt endpoint rather than relying solely on client-side verification.

Parameters

NameTypeDescription
skustringThe product's SKU (on iOS)

Returns

Promise\<{ isValid: boolean ; jwsRepresentation: string ; latestTransaction?: TransactionSk2 ; receiptData: string }>

Defined in

modules/iosSk2.ts:172