Hi all, I think what I want to do is extremely common but interestingly I could not find a single solution on the web. Those I have found are mostly outdated. Ideally there would be some copy and paste ready to use code.
Thanks a lot!
Hi all, I think what I want to do is extremely common but interestingly I could not find a single solution on the web. Those I have found are mostly outdated. Ideally there would be some copy and paste ready to use code.
Thanks a lot!
This may help Unity - Manual: Restoring Transactions
I am using the latest UnityPurchasing module 1.14.1.
I am having the same problem: when the app starts and I initialize the store i would like to check if a non-consumable item is available or not (it was purchased in the past). If I attempt to use the product.hasReceipt in the OnInitialized() callback, on iOS the password prompt appears immediately if this is the first time the app is started on the device. This is not good user experience. I would like to query the store about the availability of this product without risking password prompts on first start of the app and hopefully in a way that behaves well in offline-mode too. Ideally i need to be able to distinguish between the following use cases by checking the non-consumable product metadata at app launch:
I would like to get this info without risking showing password prompts and without starting purchase restoration automatically.
Please advise what code to write in the OnInitialized callback to find out which of the above states a non-consumable in-app-purchase is
What state is the purchase in when you receive the initial popup? If the purchase was completed previously, the expectation is there should be no password prompt. I will review your other questions also.
@seventythreeers @MariaAngelovaPD
Unity IAP does not have any inventory management features. It is left to the developer to determine the best way to handle saving and checking for existing purchases.