Hi, I am almost done implementing the IAP using Adobe Air. I just wonder whats the AmazonPurchaseEvent.PURCHASES_UPDATED good for? It is not documented for Adobe Air. I read somewhere for the Java lib, that the dev should call some refresh method on app startup, but this does not seem to exist for Adobe Air. So I am in general wondering, should I listen / handle this event at all? Is there a guarantee, that a success event for a purchase will always be called at some point, no matter if the application crashes or closes at any time during the purchase? If so, I could ignore the PURCHASES_UPDATED on only listen to success events and implement my verification queue there. Thanks
Hi Torsten, Thank you for showing interest on Amazon IAP. You can find Adobe Air plugin class reference/documentation in InAppPurchasing\plugins\adobe\docs\as3doc in Apps-SDK.zip. The event PURCHASES_UPDATED is dispatched when the status of purchased Items has been updated for the user. This event may be dispatched any time after the SDK is initialized. If any SKUs have been revoked since the last time the extension was initialized, they will be contained in the revokedSkus property. If there are any receipts available for currently updated purchases, they will be contained in the receipts property. So you need to handle this event along with other events to make sure your view of ownership is consistent across devices for an user as there is no guarantee of PURCHASE_SUCCEEDED or PURCHASE_FAILED events dispatch in case of app crashes or closes during purchase. Hope this helps.
Thanks for your reply. But as I understand, the purchaseToken differs between a SUCCESS and an UPDATE event for any given transaction. How can I distinguish between processed an unprocessed purchases of consumable items then? Lets say: User buys a consumable, I receive update event and process it on my server. Next time the user starts the app, I receive an UPDATE event with the same transaction but with a different purchaseToken. There is no way for me to know that this transaction has already been processed and should not be processed again? Thanks
Thanks, this clarifies the situation a bit. But then as I understand there can be cases in which the app crashes and the user never receives the purchased consumable. I will put all responsibility to amazon in these cases ;) Thanks for your help