Skip to main content

ADVANCED

How to detect Google Play storefront (Unity/Android)?

When distributing your app through Google Play, you may need to detect the current storefront to implement region-specific functionality. The storefront represents the Google Play region associated with the user’s account, identified by a two-letter country code in ISO-3166-1 alpha-2 format (e.g., "US" for United States).

important

This detection is particularly important in light of the Epic v. Google injunction effective October 29, 2025, which permits U.S. Google Play apps to guide users to external payment methods via link-outs, use alternative billing solutions, and prohibits anti-steering restrictions.

You can use storefront detection to:

  • Enable alternative billing options specifically for U.S. users
  • Implement region-specific payment flows
  • Control feature availability based on local billing regulations
  • Ensure compliance with U.S. court-mandated requirements

You can use the following snippet to retrieve the country code of the Google Play storefront:

important

This snippet is most useful, when distributing and installing your app through Google Play store. To check whether the app has been installed from Google Play store or side-loaded (third-party stores or APK distribution) you can use the XsollaStoreClientInfo.IsInstalledFromGooglePlayStore() utility function.

tip

Prior to retrieving the Google Play storefront country code, it's advised (but not mandatory) to verify whether Google Play Store is installed on the device as the query function will result in error if the store is not available. For this purpose you can rely on XsollaStoreClientInfo.IsGooglePlayStoreInstalled() utility function.

XsollaStoreClientInfo.QueryGooglePlayCountryCodeAsync(
onSuccess: countryCode =>
{
if (countryCode.IsCode("us"))
{
// Handle the US storefront.
}
else
{
// Handle all other storefront variants.
}
},
onError: err =>
{
// Handle the error here.
}
);