Android: in-app: check if an item has been purchased

后端 未结 1 1277
野趣味
野趣味 2021-01-17 03:44

I folloed this tutorial to implement in-app in my application: http://blog.blundell-apps.com/simple-inapp-billing-payment/

The user can now purchase my item (com.myi

1条回答
  •  生来不讨喜
    2021-01-17 04:07

    Using RESTORE_TRANSACTION is the only way if you use managed purchases. If you use unmanagaed purchases, you can store the purchase state on your own server, but that is hardly simpler. There is nothing complex about RESTORE_TRANSACTIONS: you just fire the command and you get notified with transaction information that is in the exact same format as what you get when you first purchase an item. You should process it in the exact same way, and chances are you already have the code for that in your app. Testing this is somewhat harder, because it doesn't really work with test accounts, and you need a live app. Go over the official documentation again to understand how it works.

    0 讨论(0)
提交回复
热议问题