|
|
|
|
WLanguage Procedure llamada por inAppListPurchase Procedure ("Callback") llamada por inAppListPurchase cuando se recibe la lista de las compras efectuadas. Este procedimiento puede ser local, global o interno. // Retrieve the list of purchases for the user inAppListPurchase(ListPurchase, inAppPurchaseID)
PROCEDURE ListPurchase(bSuccess is boolean, sPurchaseList is string) IF NOT bSuccess THEN ToastDisplay(ErrorInfo()) ELSE // Browses the purchases performed FOR EACH STRING sPurchaseInfo OF sPurchaseList SEPARATED BY CR // Retrieves the product identifier sProductID is string = ExtractString(sPurchaseInfo, 1, TAB) // Retrieves the purchase identifier sPurchaseID is string = ExtractString(sPurchaseInfo, 2, TAB) // Consumes the product if necessary IF sProductID = "PRODUCT_ID" THEN inAppConsumeProduct(sProductID, ConsumeProduct) END END END END
PROCÉDURE ConsumeProduct(nSuccess is boolean) IF NOT bSuccess THEN ToastDisplay(ErrorInfo()) ELSE // Consume the product in the application ... END END
Sintaxis
inAppListPurchase_Callback(<Success> , <PurchaseList>)
<Success>: booleano - True si se pudo obtener la lista de compras realizadas por el usuario,
- False en caso contrario. Para get más detalles sobre el error, utilice ErrorInfo antes de cualquier otra llamada a una función de WLanguage (esto reiniciaría el error).
<PurchaseList>: Cadena de caracteres Detalles de cada compra realizada por el usuario. La información devuelta para cada compra tiene el siguiente formato (según la información solicitada):
<Product identifier> + TAB + <Order number> + TAB + <Purchase date> + TAB + <Purchase identifier> + TAB + <Automatic renewal> + TAB + <End date of subscription> Si se enumeran varias compras, se separan por caracteres CR (Carriage Return).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|