r/iOSProgramming • u/YinnYann • 1d ago
Question Testing in app purchases. I’m confused. Help needed!
Hey there! I just got my app & in-app purchase product both reviewed and accepted; though I am facing the following issue with in-app purchases.
I cannot fetch product through TestFlight build- sandbox account. (FYI all business info are active).
The weird part is that through Xcode build with store kit I’m able to fetch the products and all functionality is working as expected. Also through store kit I’m able to sync products with AppStore connect - still with all the functionality.
A weird part (to my pov) is that when entering product id & bundle id through iOS device / settings / developer / sandbox account / manage / initiate transaction it says “The item is not available [Environment: Sandbox]”
Am I missing something? Is there a way to test fetching the products from store before release? Or is it functioning as normal and could only get the products after release?
Thanks!
2
u/DimensionMindless336 1d ago
The thing that bites almost everyone here: if you have got a StoreKit Configuration file selected in your scheme run options, Product.products(for:) reads from that local file instead of App Store Connect. So "it works in Xcode" is a false positive - it proves nothing about whether the real product is fetchable.
In TestFlight it is hitting the actual App Store Connect product, so when it comes back empty the usual causes are:
The IAP status is not truly Approved. Check App Store Connect > your app > In-App Purchases and confirm it says Approved, not Missing Metadata or Developer Action Needed. An app version getting accepted is not the same as the IAP being cleared.
The Paid Applications agreement / tax form. You said business info is active, but a lapsed tax form silently blanks products in production even when that tab looks green - worth a second look.
Product ID mismatch - it is case-sensitive. One wrong character between your code and App Store Connect has cost me a full afternoon before.
Also double-check the IAP Availability covers your testers storefront.
1
u/YinnYann 23h ago
Hey there, thanks for your reply. To provide a full reply:
- the IAP product is Approved
- yes all tax forms and fields in Business show as active.
- yes product ID is correct - I have double verified. Also when created Xcode storekit I synced the products with App Store Connect. In that case code worked as expected verifying that there is no mismatch.
- iap availability covers the same country as the sandbox test user. A small detail: the product it self is available / in the pricing and availability the countries show as yellow available on app release .
2
u/RiantRobo 1d ago
Not 100% sure but check if you created sandbox test user for IAP. Sign in using that test account on your device Settings -> Developer -> Sandbox Apple Account.
1
u/YinnYann 23h ago
Yes I have created a sandbox test account in AppStore connect and signed in through settings / developer.
1
u/xBlackSwagx 1d ago
Went through this in August. Everything looked configured, sandbox returned nothing, no error anywhere, just an empty list. Mine was the Paid Applications Agreement showing New instead of Active.
Since you say the business side is done, one thing the other replies haven't mentioned: StoreKit caches the empty result on device. Whatever the cause turns out to be, force quit the app after fixing it before you test again, otherwise the fix looks like it changed nothing. That alone ate a day for me.
And on the approval question, my products fetched fine in sandbox and TestFlight while still sitting in Prepare for Submission. So if you're getting an empty set it's an account or agreement thing, not the review status of the IAP.
1
u/YinnYann 21h ago
Hmm I am uninstalling the app and have tried a few device reset between testing. When you test the application on TestFlight and the products are retrieved - do you sign out completely from main account or simply disable the purchases section and sign in developer / sandbox account?
1
1
3
u/myballzhuert 1d ago
I had the same issue. Long shot but in my case I had not completed all the “paperwork” to setup my App Store Connect account. In my case I did not complete my banking info. At no time did I get any type of account setup not complete, nobody from Apple said anything. But when my app in sandbox went to get the subscription it would return nothing.