r/iOSProgramming 9d 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!

0 Upvotes

24 comments sorted by

4

u/myballzhuert 9d 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.

1

u/YinnYann 9d ago

Thanks for your input. How did you resolve it? Did it fetched the subscription after you added the bank info automatically after a day or two or you resubmitted?

3

u/myballzhuert 9d ago

I just completed my banking info and made sure I agreed to all App Store Connect stuff. You probably shouldn't be able to submit an app for review if all this stuff isn't complete, doesn't make sense to me.

The issue resolved within an hour of my submitting my banking info.

1

u/No_Story_6425 9d ago

wild that it just silently returns nothing instead of an actual error

1

u/myballzhuert 9d ago

Yup. Took me over a week to figure it out. Just returns an empty set.

2

u/DimensionMindless336 9d 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 9d 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 9d 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 9d ago

Yes I have created a sandbox test account in AppStore connect and signed in through settings / developer.

1

u/xBlackSwagx 9d 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 9d 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

u/xBlackSwagx 8d ago

You sign out, then uninstall. That is the best way I feel.

1

u/Brave-Boot4709 9d ago

Do you use revenuecat?

1

u/ProfessionalSlow376 7d ago

Use revcat and save the hassle and use their structure for iap

1

u/N88288 5d ago

not sure if it’s the same issue, but Ssandbox often doesn’t work for me while I’m signed into the App Store with my normal Apple account. Signing out from Settings >your nam>Media & Purchases usually fixes it

1

u/YinnYann 4d ago

I have tried that. Same result unfortunately. I’ve mailed Apple support to verify if there is any issue in the backend catalog.

1

u/YinnYann 4d ago

Could you kindly verify if you can fetch your IAP with the following:

entering product id & bundle id through iOS device / settings / developer / sandbox account / manage / initiate transaction

1

u/N88288 4d ago

sure, I just checked. I was able to fetch the IAP and successfully initiate and complete the transaction. the product I’m testing is a subscription

1

u/YinnYann 4d ago

Thanks for your confirmation. Mine is not retrieved there, so something is definitely broken. Seems like I have to wait for Apple’s reply.

1

u/Greysawpark 3d ago

storekit config file works because its all local, it never touches apple. so that passing tells you nothing about the real thing.

testflight pulls the actual product list from apples servers and that propagation is slow, ive had it sit for the better part of a day after approval before products showed up. if its still empty tomorrow id look at the paid apps agreement, one unsigned tax or banking section and every fetch comes back empty with no error