Question

Storekit Configuration not picked up by Simulator

  • 5 April 2022
  • 8 replies
  • 523 views

Badge +6

Hi,

I’m in a situation where I have to test on a simulator, but despite setting up my StoreKit Configuration, I continue to hit a brick wall. Note, testing on a device was working fine.

I’ve scoured as many relevant help articles as I could find on the community, but I’m still stuck.

Specifically, I get an error message saying the product identifier I’ve created in my StoreKit Configuration is invalid, and that an SKProduct could not be found.

Invalid Product Identifiers - (
"com.gravy.dev.monthly_4.99"
)
Could not find SKProduct for (
"com.gravy.dev.monthly_4.99"
)

I’ve tried this in a few different ways, always making sure the product existed in RevenueCat, and was apart of a “current” offering. That, and I’ve made sure to attach the StoreKit Configuration in my run options on the current target - but still no luck.

Also, fwiw, I tried mimicking a current App Store Connect setup in my StoreKit Configuration, but that didn’t work either. Upon checkout, I’d get an error saying there was a “problem with the App Store”.

Any help would be really appreciated.

Thanks in advance ...


8 replies

Userlevel 5
Badge +9

Hey @Gravy Developer!

 

So just to confirm, you do not receive this error when testing on a physical device? That most likely points to the StoreKit config file - which is good because it means you’ve probably got the product setup piece done correctly 😅

 

You’ll need to re-upload the StoreKit certificate to RevenueCat any time there is a change made to it. Can you try re-uploading the latest version and seeing if that works? https://docs.revenuecat.com/docs/apple-app-store#step-4-uploading-the-public-certificate-to-revenuecat

Badge +6

Hey, thanks @ryan - so I walked through the steps, and re-uploaded the StoreKit Config. However, I’m still having the same issue. From looking at the logs, it seems like RevCat is trying to pull the products I have in my StoreKit Config down from the App Store. Then when it can’t find them, it throws the error.

That said, it seems like this could be part of the problem - the fact that RevCat is trying to retrieve products from App Store Connect when the StoreKit Config is set in Run options?

-

Attaching the relevant logs and a screenshot showing the Configuration.storekit set in Run options

Userlevel 5
Badge +10

Hey @Gravy Developer 

Have you also made sure to include the product ID inside the StoreKit configuration file as well? For reference:

While the product should exist inside RevenueCat, it should also exist inside the StoreKit config file as well. Can you double check this and let us know if you’re still experiencing issues? 

Badge +6

Hi @tina, yes, the product ID is spec’d in the StoreKit configuration file. See below ...

 

Userlevel 5
Badge +9

Hey @Gravy Developer thanks for the logs and additional info. Yeah, it seems like it’s just that single product ID that is causing problems, “com.gravy.dev.monthly_4.99”.

Have you double checked the Run Scheme you’re using is set to use the StoreKit config file? The run scheme in XCode will determine whether products are pulled from Apple servers or the StoreKit config file. This is done at Build/Run time and is not a code-level setting. https://docs.revenuecat.com/docs/apple-app-store#step-2-create-a-new-scheme-for-storekit-testing

 

 

Badge +6

Thanks @ryan - actually yeah, if you look at the first screenshots I posted, you’ll see the Run → Options for my scheme has the StoreKit Configuration set. That said, I didn’t create a separate scheme solely for StoreKit runs.. I’ve simply set the StoreKit Configuration on my dev scheme’s Run/Options. Which, from what I’ve read on Apple’s Docs, seems to be all that is needed. Thoughts?

Also, fwiw, I get the Invalid Product Identifier error with, or without, specifying the StoreKit Configuration file in my run options.

Userlevel 5
Badge +9

That’s so strange it’s just happening with that one product! 

 

Also, fwiw, I get the Invalid Product Identifier error with, or without, specifying the StoreKit Configuration file in my run options.

Like you said, it’s almost like the configuration file is just being ignored. But you do not get the error when running on a physical device with that product ID? (com.gravy.dev.monthly_4.99)

 

Is the product com.gravy.dev.monthly_4.99 configured in App Store Connect? I assume no, but maybe that could be a workaround for now since the rest of the product IDs appear to fetch properly (from the logs you shared) through the simulator. 

Badge +6

Well that is the one product that is spec’d in the StoreKit Configuration, and you are correct, it’s not in App Store Connect. However, that’s on purpose. My understanding from Apple (and per your docs) is that you shouldn’t have to set up products in App Store Connect if you want to test locally. I thought that was the point of using the StoreKit Configuration.

 

None the less, okay, well thanks for your help. We can close this if you want.

Reply