Skip to Content
Swift SDKGuidesMarket Availability

Market Availability

The SDK can check whether the user’s market is available before enabling engagement features. If unavailable, all SDK components are disabled silently — no error states shown to the user.

How to Enable

Pass userCountryCode when loading configuration:

import VioCore @main struct MyApp: App { init() { // SDK checks if Norway is in the available markets list ConfigurationLoader.loadConfiguration(userCountryCode: "NO") } }

The SDK calls the backend to get the list of available markets and compares against userCountryCode. If not available, VioConfiguration.shared.isMarketAvailable is set to false.

Without Country Check

If you don’t pass userCountryCode, the SDK assumes the market is available:

ConfigurationLoader.loadConfiguration() // always available

Reading Availability

let available = VioConfiguration.shared.isMarketAvailable let shouldUse = VioConfiguration.shared.shouldUseSDK // isConfigured && isMarketAvailable // Check a specific country let norwaySafe = VioConfiguration.shared.isMarketAvailableForCountry("NO") // Get full market info if let info = VioConfiguration.shared.getMarketInfo(for: "NO") { print("Currency: \(info.currency?.code ?? "NOK")") }

Typical Flow for Streaming Apps

// 1. At startup — check if Norway is available ConfigurationLoader.loadConfiguration(userCountryCode: "NO") // 2. Before showing the engagement overlay guard VioConfiguration.shared.shouldUseSDK else { return } // 3. Connect to broadcast await CampaignManager.shared.setBroadcastContext(context)

Next Steps

Last updated on