Retrieve non-consumable item after unistall

Hello :slight_smile:

I’ve created a non-consumable product. With MyIAPManager.cs, I launch a function (setta_premium) if purchase complete successfull.
And work perfectly!

My problem is if an user buy the non-consumable and then uninstall the game.
I’ve tried to rebuy the product and this is the message on logcat:
" Unity IAP: Already recorded transaction … "

How I can check if the product is already purchased?

7126859–851411–MyIAPManager.cs (5.29 KB)

If the user uninstalls then reinstalls, you should get a ProcessPurchase callback upon IAP Initialization for all non-consumable and subscription products. You’ll want to place Debug.Log statements in your ProcessPurchase to confirm. But you’re looking for a product named “premium” and you don’t have one. Where are you adding your products? You are not adding any in this script. Ensure that you are not mixing Codeless and Scripted IAP.

Oh OK: I mixed Codeless with scripted IAP.

Now I’ve cutted the component IAP from the button and the button onclick call the new funcion BuyPremium() inside MyIAPManager created just now (with the product “premium”, of course).
It’s work!

Work this method with Google and UDP too?

Thank a lot for your help!

7127057–851429–MyIAPManager.cs (5.51 KB)

Yes, looks correct. But so you know, the return_complete logic is not needed in your code, you can remove it. There is no harm if you leave it, but it’s not needed. It’s used only for testing.