CdvPurchase.AppleAppStore.Adapter
Adapter for Apple AppStore using StoreKit version 1
- addValidProducts
- checkSupport
- finish
- getProduct
- handleReceiptValidationResponse
- initialize
- load
- manageBilling
- manageSubscriptions
- order
- presentCodeRedemptionSheet
- receiptValidationBody
- requestPayment
- restorePurchases
• new Adapter(context
, options
)
Name | Type |
---|---|
context |
AdapterContext |
options |
AdapterOptions |
• _products: SKProduct
[] = []
List of products loaded from AppStore
• Optional
_receipt: SKApplicationReceipt
The application receipt, contains all transactions
• bridge: Bridge
• context: AdapterContext
• Optional
discountEligibilityDeterminer: DiscountEligibilityDeterminer
Component that determine eligibility to a given discount offer
• id: Platform
= Platform.APPLE_APPSTORE
Platform identifier
• log: Logger
• name: string
= 'AppStore'
Nice name for the adapter
• needAppReceipt: boolean
True when we need to validate the application receipt
• ready: boolean
= false
true after the platform has been successfully initialized.
The value is set by the "Adapters" class (which is responsible for initializing adapters).
• get
isSupported(): boolean
Returns true on Android, the only platform supported by this adapter
boolean
CdvPurchase.Adapter.isSupported
• get
products(): Product
[]
List of products managed by the adapter.
Product
[]
CdvPurchase.Adapter.products
• get
receipts(): Receipt
[]
List of purchase receipts.
Receipt
[]
CdvPurchase.Adapter.receipts
▸ addValidProducts(registerProducts
, validProducts
): void
Name | Type |
---|---|
registerProducts |
IRegisterProduct [] |
validProducts |
ValidProduct [] |
void
▸ checkSupport(functionality
): boolean
Returns true if the platform supports the given functionality.
Name | Type |
---|---|
functionality |
PlatformFunctionality |
boolean
▸ finish(transaction
): Promise
<undefined
| IError
>
Finish a transaction.
For non-consumables, this will acknowledge the purchase. For consumable, this will acknowledge and consume the purchase.
Name | Type |
---|---|
transaction |
Transaction |
Promise
<undefined
| IError
>
▸ getProduct(id
): undefined
| SKProduct
Find a given product from ID
Name | Type |
---|---|
id |
string |
undefined
| SKProduct
▸ handleReceiptValidationResponse(_receipt
, response
): Promise
<void
>
Handle platform specific fields from receipt validation response.
Name | Type |
---|---|
_receipt |
Receipt |
response |
Payload |
Promise
<void
>
Adapter.handleReceiptValidationResponse
▸ initialize(): Promise
<undefined
| IError
>
Initializes a platform adapter.
Will resolve when initialization is complete.
Will fail with an IError
in case of an unrecoverable error.
In other case of a potentially recoverable error, the adapter will keep retrying to initialize forever.
Promise
<undefined
| IError
>
▸ load(products
): Promise
<(IError
| Product
)[]>
Load product definitions from the platform.
Name | Type |
---|---|
products |
IRegisterProduct [] |
▸ manageBilling(): Promise
<undefined
| IError
>
Open the platforms' billing management interface.
Promise
<undefined
| IError
>
▸ manageSubscriptions(): Promise
<undefined
| IError
>
Open the platforms' subscription management interface.
Promise
<undefined
| IError
>
▸ order(offer
): Promise
<undefined
| IError
>
Initializes an order.
Name | Type |
---|---|
offer |
Offer |
Promise
<undefined
| IError
>
▸ presentCodeRedemptionSheet(): Promise
<void
>
Promise
<void
>
▸ receiptValidationBody(receipt
): undefined
| Body
Prepare for receipt validation
Name | Type |
---|---|
receipt |
Receipt |
undefined
| Body
▸ requestPayment(payment
, additionalData?
): Promise
<undefined
| IError
| Transaction
>
Request a payment from the user
Name | Type |
---|---|
payment |
PaymentRequest |
additionalData? |
AdditionalData |
Promise
<undefined
| IError
| Transaction
>
▸ restorePurchases(): Promise
<void
>
Replay the queue of transactions.
Might ask the user to login.
Promise
<void
>