How do I easily restore purchases using the Amazon API?

时间秒杀一切 提交于 2019-12-10 19:11:46

问题


I'm trying to restore purchases just like iOS, and I can't figure out how to easily restore an IAP entitlement purchase with the Amazon API.

If I send another request with the SKU to the PurchasingManager, it returns a PurchaseResponse, but that PurchaseResponse doesn't return a valid Receipt if the SKU has already been purchased. It's null.

Seems like I would need that SKU to do any kind of processing.


回答1:


Found how to do this.

Turns out a different function call is needed instead of the initiatePurchaseRequest call.

PurchasingManager.initiatePurchaseUpdatesRequest(Offset offset)

This call gets all the purchases the user has made then returns them to the PurchasingObserver to be handled by:

PurchasingObserver.onPurchaseUpdatesResponse(PurchaseUpdatesResponse purchaseUpdatesResponse)


来源:https://stackoverflow.com/questions/14078428/how-do-i-easily-restore-purchases-using-the-amazon-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!