- Home /
Codeless IAP: PurchaseFailureReason.Unknown for iOS
I am using Codeless IAP. On Android, Codeless IAP is working fine with our Beta deployment. On iOS, I keep getting the error "PurchaseFailureReason.Unknown". In the logs I'm seeing the following error code:
"UnityIAP: PurchaseFailed: 0"
Seeing this behavior both in the Sandbox environment and with TestFlight.
I've already completed the following steps:
Added all products in AppStoreConnect, and verified that all products are listed as "Ready to Submit"
Accepted the "Paid Apps" agreement in App Store Connect
Filled out all the Tax/Banking info in App Store Connect
Using "Automatically manage signing" within Xcode. I added "In-App Purchase" in the "Capabilities" section
Validated that IAP initialization is not throwing errors. I'm seeing "UnityIAP: Received 4 products" in the logs, which makes it seem like IAP is initializing fine.
In both Sandbox and TestFlight, I am seeing the behavior where I get the "Confirm Your In-App Purchase" prompt. I type in the appropriate password, and then I get the same password prompt again. After I type in the password a second time, then I see the "Done" message with a checkmark within the prompt, but I then get the "PurchaseFailureReason.Unknown" message inside the "OnPurchaseFailed" handler.
Any ideas what I might be missing?
Answer by TatersGonnaT8 · Jul 31, 2020 at 05:14 PM
Ok so I think I've figured out the issue here. Once all of the above steps are completed, you also have to add the in-app purchases to the actual (non-TestFlight) version of the build in AppStoreConnect.
Go to AppStoreConnect, go to the main "App Store" tab, and click on your app version under "iOS App" that most likely says "Prepare for Submission"
Scroll down to the "In-App Purchases" section
Add all of the applicable In-App purchases that you're trying to test.
Once I finished those steps, then I was able to successfully test the IAPs on iOS. Very confusing that we need to add the IAPs for the PROD build even though we're just testing on TestFlight!
Your answer
![](https://koobas.hobune.stream/wayback/20220613004051im_/https://answers.unity.com/themes/thub/images/avi.jpg)