purchaseStateUpdate |
Type | message |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | purchaseStateUpdate <pPurchaseID>, <pProductID>, <pState>
|
Summary | Sent by the store to notify the app of any changes in state to the
purchase request.
|
Introduced | 6.7 |
OS | ios, android |
Platforms | mobile |
Parameters | Name | Type | Description |
---|
pPurchaseID | | The identifier of the purchase request
|
pProductID | | The product identifier for which the purchase request was made
|
pState | | The state of the purchase request "initialized": the purchase request has been created but not sent
"sendingRequest": the purchase request is being sent to the store
"paymentReceived": the requested item has been paid for. The item should now be delivered to the user and confirmed via the command
"alreadyEntitled": the requested product is already owned and cannot be purchased again
"invalidSKU": the requested item does not exist in the store listing
"complete": the purchase has now been paid for and delivered
"restored": the purchase has been restored after a call to . The purchase should now be delivered to the user and confirmed via the command
"cancelled": the purchase was cancelled by the user before payment was received
"error": an error occurred during the payment request. More detailed information is available from the function
|
|
Example | on purchaseStateUpdate pPurchaseID, pProductID, pState
switch pState
case "paymentReceived"
answer "payment received!"
offerPurchasedProduct pProductID
mobileStoreConfirmPurchase pProductID
mobileStoreDisablePurchaseUpdates
case "error"
answer "Error occurred during purchase handling:" \
&& mobileStorePurchaseError(pPurchaseID)
mobileStoreDisablePurchaseUpdates
case "invalidSKU"
answer "Invalid SKU."
mobileStoreDisablePurchaseUpdates
case "alreadyEntitled"
answer "Already Owned."
mobileStoreDisablePurchaseUpdates
case "restored"
answer "restored!"
offerPurchasedProduct pProductID
mobileStoreConfirmPurchase pProductID
mobileStoreDisablePurchaseUpdates
case "cancelled"
answer "Purchase Cancelled:" && pProductID
mobileStoreDisablePurchaseUpdates
end switch
end purchaseStateUpdate
|
Related | Command: mobileStoreRestorePurchases, mobileStoreDisablePurchaseUpdates, mobileStoreEnablePurchaseUpdates, mobileStoreRequestProductDetails, mobileStoreMakePurchase, mobileStoreSetProductType, mobileStoreConsumePurchase, mobileStoreConfirmPurchase, mobileStoreVerifyPurchase
Function: mobileStoreProductProperty, mobileStorePurchasedProducts, mobileStorePurchaseError, mobileStoreCanMakePurchase
Message: productRequestError, productDetailsReceived
|
Description | Use the purchaseStateUpdate message to notify the app of any changes
in state to the purchase request.
The message purchaseStateUpdate is used to notify the app of any
changes in state to the purchase request. It is sent by the store in
response to new purchase requests or restore completed purchases
requests.
|