Storefront.current?.countryCode returns inconsistent values in TestFlight builds

Hi,

We're experiencing inconsistent and unexpected values returned by Storefront.current?.countryCode when running our app via TestFlight.

In our case:

  • The device region and locale are set to Poland
  • The App Store account (Media & Purchases) is also set to Poland

However, when running a TestFlight build, Storefront.current?.countryCode sometimes returns a completely different value (e.g. "NO" for Norway), which does not match the current App Store account configuration.

Here's the code we're using:

if #available(iOS 15.0, *) {
    let code = await Storefront.current?.countryCode
    print("Storefront countryCode:", code ?? "nil")
}

What's particularly confusing:

  • Across different devices logged into the same App Store account, we sometimes receive different countryCode values
  • The returned value does not seem to reflect the current App Store region or device settings

We understand that Storefront reflects the App Store storefront and not the device locale, but in this case the value appears stale or incorrect even with a properly configured App Store account.

Questions:

  1. Is Storefront.current?.countryCode expected to behave differently in TestFlight vs. production builds?
  2. Are there known caching or propagation delays for storefront updates across devices?
  3. Can TestFlight builds return outdated or inconsistent storefront values?
  4. What is the recommended way to reliably determine the user's App Store region in this scenario?

We rely on storefront to determine regional availability of features, so understanding this behavior is important for us.

Thanks in advance for any clarification!

I observed the following:

On a test device, I signed out of the production App Store account. I then created a sandbox account in App Store Connect with a specific region. After signing in on the device using only that sandbox account, and with no production App Store account signed in, Storefront.current?.countryCode started returning the expected store country and matched the sandbox account region.

@Apple Given this behavior, can we assume that in production builds downloaded from the App Store, Storefront.current?.countryCode will reliably reflect the user’s actual App Store storefront? Or are there known cases where the returned value may still be stale or inconsistent (e.g. due to caching or account history)?

Storefront.current?.countryCode returns inconsistent values in TestFlight builds
 
 
Q