Reputation: 115
How can I find which IAP-items the user has bought previously with Codename One? I use the Purchase class implementation but the method getProducts(skus) returns null and the method wasPurchased(sku) throws an exception. The more tricky part of the question is: whatif the user has changed his/hers device (same vendor/another device), how can I evaluate what the user has bought/subscribed previously?
best babür
Upvotes: 1
Views: 55
Reputation: 52760
This is an iOS feature/requirement but it's relatively simple to implement. You can use the isRestoreSupported
method which will work on iOS.
Then invoke restore()
which should cause the paymentSucceeded
callback to be invoked repeatedly with previous purchases from the user.
Upvotes: 1