How to detect iOS Storefront?
When distributing your app through Apple's App Store, you may need to detect the current storefront to implement region-specific functionality. The storefront represents the App Store region that the user is currently using, identified by a three-letter country code (e.g., "USA" for United States).
This detection is particularly important following the US court decision dated April 30, 2025, which allows developers to connect external payment links in the United States. You can use the storefront detection to:
- Enable external payment links specifically for US users
- Implement region-specific payment flows
- Control feature availability based on regional requirements
- Ensure compliance with local regulations
To determine the current iOS storefront and control SDK functionality based on the region, use the following code snippet:
XsollaStoreClientInfo.GetAppleStorefront((storefront, error) =>
{
if (error != null)
Debug.LogError($"Failed to get Apple Storefront: {error}");
else
Debug.Log("Apple Storefront: " + storefront);
});