Are you testing on TestFlight on your iPhone/iPad and have made a successful purchase? And your productID is actually just “1”? Please show a screenshot of your Apple dashboard showing this product as available for sale. Ensure to follow the steps here https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html
@nathanlin You need to wait until IAP finishes initializing, so in OnInitialized or later. I saw your logs for a second and it shows “DuplicateTransaction” so you’ve had a purchase already. If possible, please answer all questions directly and provide the requested screenshots. If the user actively cancels the purchase, then OnPurchaseFailed will be called with reason code “User Cancelled”
Hi. I use to delete the app and switch to another sandbox account, but the hasReceipt product I bought still return true.
For subscriptions is product.hasrecipe no suit for check if the user canceled or expired ?
If the new user bought the product then hasReceipt should be true. Is the product actually canceled or expired? Which one? If this is a subscription, you’ll want to use the SubscriptionManager, as mentioned earlier. Please show the code you are currently using to check the receipt.
What I mean is that hasReceipt still returns true if I switch to another account on this phone or reinstall the app without the subscription being cancelled or expired.
To really get the current subscription state at all times, you would need to use receipt validation and receive App Store notifications for cancel/expire/refund events. Look for App Store notifications and Google RTDN.
Small advertising note: I offer a serverless solution including an Unity example project:
I don’t know where you get these methods from, but you should really use the OnInitialized callback from Unity IAP, not write the methods below each other like that, and do not use a WaitForSeconds coroutine.
HI, i use the sample-iap-project, and i have test everything ok in appstore ,
but in the google store internal testing, I write the correct product ID and add the tester in license testing. but the paying page does not show up when I click the purchase button.
If this is a subscription, it must be auto-renewing. If you are using the Sample IAP Project, the Debug.Log output is written to the UI, very handy for debugging. Please share any errors you might be seeing. Otherwise, please provide the device logs (which will include your Debug.Log statements) https://discussions.unity.com/t/699654 .