StoreKit 2 Product.products(for: productIdentifiers) coming back empty for a single user in production

I have recently updated my app to use StoreKit 2 for in-app purchases and, for the most part, everything seems to be working as expected in production. However, I have a single user who is unable to retrieve the in-app purchase product list.

I am making a straightforward call to retrieve the products:

sk2Products = try await Product.products(for: productIdentifiers)

The expected outcome is that it returns the three products that I have for sale. For the user in question, the call does not fail but it returns an empty array.

As far as I can tell, all other users on the same version of the app are having no problem and I am not able to reproduce the issue in the sandbox or in production on my own devices or the simulator. It doesn't make much sense to me how this could be happening to only one user, especially considering that the product request is not even asking for data related to a specific Apple ID. Not to confuse the issue but the same user is also having trouble having his auto-renewable subscription recognized while, again, nobody else seems to be having a problem. Interestingly, the app did recognize the user's subscription for one session but then went back to the same failing behavior that it is now consistently exhibiting. It's possible that StoreKit is doing some kind of local cacheing that is causing this problem but users' subscription information, etc, is fetched on each app launch so the failure is not related to any cacheing being done by the app itself. The StoreKit calls are returning bad data.

Is there anything that a user can do on their device that might make this happen?

Similarly, is there anything I could have the user do to try to clear up the problem? Restarting the device did not help.

Simple things if not already tried:

  • Reinstall the app
  • Restart the device
  • Disable any kind of VPN or network blocks

Assuming the user has already done the above, I would recommend having the user file a ticket in Feedback Assistant (http://feedbackassistant.apple.com) with a sysdiagnose if possible.

Thank you for the reply. I will have the user go through these steps and hopefully he will get it resolved.

I do have to say it is a bit unsettling that this condition is possible and, even more so, that it is not an error condition at the code level. I hope someone looks into it because I'd hate to have another user run into the same trouble.

Thanks again for the help!

I'm actively working with Apple support on this same thing. Not sure if you can see this:

https://feedbackassistant.apple.com/feedback/13242068

But essentially, in production, no device gets back any of my subscriptions.

Works in dev in simulator and on-device and even for the approval process, but not at all in production.

If I get anything back that helps I'll follow up here, but my gut is now that there is a StoreKit 2 issue.

I have a similar issue in a SpriteKit app under iOS 15.0. There was a crash in an iPad 8th generation with iOS 17.1.2 (21B101) where the crash log pointed to this code with an index out of bounds error:

    Task {           
              do { let products   = try await Product.products (for: productId_Subscription)
               Global_Variables.gbIsSubscribed = try await mPurchaseManager.isPurchased (products [0] )
              }
           catch { print ( "error" ) }            
         }

I use the exact code in a half dozen other apps with no reported crashes and can't duplicate the error on my iPad in the Sandbox. Hope this helps.

Same here, and progress? any resolution?

StoreKit 2 Product.products(for: productIdentifiers) coming back empty for a single user in production
 
 
Q