[Solved] Unity 5.3 IAP need help

Hello there currently I’m using soomla IAP and soomla is getting discontinued so i wanna switch to Unity IAP.
So, what i want know is how to lock and unlock item like car/character with a code
this is how i do it with soomla

Update ()
{
int redcar = StoreInventory.GetItemBalance(“red_car”);
if (redcar == 1)
{
redcar.GetComponent().enable = true;
locked_image.GetComponent().enable = false;
}
}

Soomla knows that 0 is not owned and 1 is owned

Unity IAP does not maintain a purchase database for you, though there are third party solutions on the Asset store that can assist with this.

Is red_car a non consumable? If so you can check whether the user has a valid receipt for it, see the receipt validation guide.

Yes red_car is non consumable and thank you for response so, under receipt i should save with playerprefs when something is unlocked and have it locked by default?

If it is a non consumable then you don’t need to save to playerprefs; you can use the receipt validation library to parse and validate the receipt and figure out if the player is entitled to it; receipts are permanently available for non consumables.

@Choppa , yes, saving it in playprefs would work.

Please let me know if you have any more questions :slight_smile: