getStorefront
Get the storefront country code for the active user.
iOS: Reads Storefront.current?.countryCode (StoreKit 2). Returns the user's App Store storefront, not the device locale. Apple docs. Android: Reads BillingConfig.countryCode from BillingClient.getBillingConfigAsync. Reflects the Play Store account region, not the SIM/device locale. Google docs.
Signature
swift
func getStorefront() async throws -> StringReturns#
Promise<string> — the store account's country code. StoreKit returns ISO 3166-1 alpha-3 (for example "USA" or "KOR"). Google Play Billing and Horizon return alpha-2 country codes, while Amazon returns its alpha-2-like UserData.marketplace value (for example "US" or "DE"). This is not the device locale. A failed store lookup rejects or throws a platform-mapped purchase error.
Example
swift
let countryCode = try await OpenIapModule.shared.getStorefront()