I’ve seen this question: Android – how to check if in app purchase has already been done?
It is not very clear to me however. I am using the AndroidBillingLibrary, mentioned in the answer, and I have a couple of questions.
When using restoreTransactions(), does that mean that at that point the purchases are stored on the device itself? Couldn’t that be manipulated somehow?
And what if I buy an item on an other device, how does the first device know this? Do I need to restore again?
Thanks in advance
For the first question, every purchase is managed with an ID, thus only managed items work with
restoreTransactions(). Also,restoreTransactions()does not work for reserved Product IDs. Thus it is still safe.Ideally you should call
restoreTransactions()every time the app runs. The Key thing is that all transactions are paired with the device/user ID (not sure how Google handles authentication on their server side but I assume it is using a combination of your Google account as well as the phones that the Google account is paired to).So, if someone were to modify the transaction file, it will get invalidated when it is compared to the logfile on Google’s side.
Hope this clarifies things 🙂