Android IAP Non Consumable Restore Behaviour

Unity Version: 2018.2.0f2
IAP Version: 2.0.3

I’m creating my first android app and trying to have a non consumable purchase to remove adverts.

The purchase works fine, however when the app is restarted it is not restored, if you then try to re purchase it gives the error “Duplicate Transaction”, showing that the purchase has been done.

I’m storing the non consumable purchase locally which is used if the app doesn’t connect to the store, however if the game does connect I want it to use the stores information as this prevents editing of local files, and will revert the purchase correctly if refunded and I believe is they way it should work.

If I clear the IAP Cache with the command UnityPurchasing.ClearTransactionLog(), the purchase restoring works as how i think it should when you launch the game however the documents say this command should be used for testing only and not in a release.

What is the correct way to implement this all the examples I have found including Unity’s own documentation have the problem i described above.

Thanks,

Ken

I solved my problem,

For anyone else that has this issue the answer is no make sure with non-consumable transactions you use PurchaseProcessingResult.Pending and NOT PurchaseProcessingResult.Complete.

If you use complete the IAP will not restore non consumable products. To me this seems very unintuitive but is they way it works, surely by default non consumable products should be restored or you can just use a consumable product and set it to pending to get the same behavior making non-consumable products obsolete?!?!

Ken