Environment Variables
Override configuration at runtime — useful for switching between demo configs and CI/CD.
Xcode Setup
Edit Scheme → Run → Environment Variables
| Variable | Values | Description |
|---|---|---|
VIO_CONFIG_TYPE | viaplay, tv2, automatic | Loads vio-config-<type>.json |
VIO_ENVIRONMENT | production, development, sandbox | Override environment |
VIO_USER_COUNTRY | NO, SE, DK, GB… | Override market country check |
Multi-Config Setup
Useful for demoing multiple clients (Viaplay, TV2) from the same codebase:
App Bundle
├── vio-config-viaplay.json → VIO_CONFIG_TYPE=viaplay
├── vio-config-tv2.json → VIO_CONFIG_TYPE=tv2
└── vio-config.json → default (no variable needed)Config Priority
VIO_CONFIG_TYPEenvironment variable → loadsvio-config-<type>.jsonvio-config.json(no variable)vio-config-automatic.jsonvio-config-example.json- SDK defaults
Load from Environment Programmatically
// Reads VIO_API_KEY, VIO_ENVIRONMENT, VIO_CONFIG_TYPE from ProcessInfo
ConfigurationLoader.loadFromEnvironment()Country Override
// Load config, then check market availability for Norway
ConfigurationLoader.loadConfiguration(userCountryCode: "NO")Combined with VIO_USER_COUNTRY in the scheme, useful for testing market availability without changing code.
Next Steps
- Configuration — Full vio-config.json reference
- Dark/Light Mode — Theme switching
Last updated on