IAP issue with non-consumable items' state

Hi guys. I am playing with IAP for about month. And there is some problems with non-consumable purchases.
The problem is incorrect item.state defining.
I have a restart button which simply restarts a scene. And as it’s not necessary to register items each time you restart a round I created a global bool so items are registered once a session.
But there’s a problem: bought non-consumable items have an approved state instead of owned (and item.owned key is false) after game’s restart. Yep, just after a purchase it shows owned:true and state:owned for the item until a game is not restarted.
Weeks of debugging and I found that if that Boolean is removed so items register each time you restart a scene, it shows right items properties after a second scene starting (so registering actions are performed twice).

The bug is still present, but I found a solution for owned state defining → In-app purchase NULL - #13 by Zune

1 Like