Skip to content

Configuration Variables Guide

This document describes all configurable variables for partners/resellers to customize their ECall iOS application.

Overview

ECall iOS uses Build Settings variables that are injected into Info.plist at build time. This allows partners to configure their application without modifying source code.

Required Configuration Variables

API Credentials

APP_API_ID

  • Type: String
  • Description: Partner API ID provided by ECall partner program
  • Example: "12345678"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: APP_API_ID

APP_API_HASH

  • Type: String
  • Description: Partner API hash for authentication
  • Example: "a1b2c3d4e5f6g7h8"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: APP_API_HASH
  • Security: Keep secret, never commit to version control

Backend URLs

API_BASE_URL

  • Type: String (URL)
  • Description: Base URL for REST API endpoints
  • Example: "https://api.example.com" or "https://stg-api.example.com"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: API_BASE_URL
  • Required: Yes

SOCKET_BASE_URL

  • Type: String (WebSocket URL)
  • Description: Base URL for STOMP WebSocket signaling
  • Example: "wss://api.example.com" or "wss://stg-api.example.com"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: SOCKET_BASE_URL
  • Required: Yes

JANUS_SOCKET_URL

  • Type: String (WebSocket URL)
  • Description: WebSocket URL for Janus Gateway
  • Example: "wss://api.example.com/janus"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: JANUS_SOCKET_URL
  • Required: Yes

SHARE_URL

  • Type: String (URL)
  • Description: Base URL for sharing/universal links
  • Example: "https://app.example.com/share"
  • Default: "https://app.example.com/share"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: SHARE_URL
  • Required: No (has default)

Domain Configuration

BASE_DOMAIN

  • Type: String
  • Description: Base domain for associated domains and universal links
  • Example: "example.com" or "yourcompany.com"
  • Default: "example.com"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: BASE_DOMAIN
  • Usage: Used to generate associated domains (applinks:$(BASE_DOMAIN))

App Identity

BUNDLE_URL_SCHEME

  • Type: String
  • Description: Custom URL scheme for deep linking
  • Example: "yourapp" or "yourcompany"
  • Default: "yourapp"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: BUNDLE_URL_SCHEME
  • Usage: Used in CFBundleURLSchemes for deep linking

CFBundleDisplayName

  • Type: String
  • Description: App display name shown under icon
  • Example: "Ecall" or "YourCompany Call"
  • Location: Build Settings → Product Name or Info.plist
  • Info.plist Key: CFBundleDisplayName
  • Note: Can be set directly in Info.plist or via Product Name

Google Sign-in

GOOGLE_CLIENT_ID

  • Type: String
  • Description: Google OAuth Client ID
  • Example: "123456789-abcdefghijklmnopqrstuvwxyz123456.apps.googleusercontent.com"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: GOOGLE_CLIENT_ID
  • Required: Yes (if using Google Sign-in)

GOOGLE_URL_SCHEME

  • Type: String
  • Description: Google URL scheme for OAuth callback
  • Example: "com.googleusercontent.apps.123456789-abcdefghijklmnopqrstuvwxyz123456"
  • Default: Computed from GOOGLE_CLIENT_ID (see below)
  • Location: Build Settings → User-Defined Settings (optional)
  • Info.plist Key: GOOGLE_URL_SCHEME
  • Auto-compute: If not provided, computed from GOOGLE_CLIENT_ID using format: com.googleusercontent.apps.{CLIENT_ID_WITHOUT_SUFFIX}

Environment

ENVIRONMENT_NAME

  • Type: String
  • Description: Environment identifier (consumed by EnvironmentType / AppEnvironment.current)
  • Values: "Dev", "Staging", "Production"
  • Default: "Staging"
  • Location: Build Settings → User-Defined Settings
  • Info.plist Key: ENVIRONMENT_NAME

Configuration in Xcode

  1. Select project in Project Navigator
  2. Select target ecall
  3. Go to Build Settings tab
  4. Click +Add User-Defined Setting
  5. Add each variable with appropriate value

Method 2: xcconfig Files

Create .xcconfig files for each configuration:

Config-Staging.xcconfig:

API_BASE_URL = https://stg-api.example.com
SOCKET_BASE_URL = wss://stg-api.example.com
JANUS_SOCKET_URL = wss://api.example.com/janus
APP_API_ID = YOUR_PARTNER_API_ID
APP_API_HASH = YOUR_PARTNER_API_HASH
GOOGLE_CLIENT_ID = YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com
GOOGLE_URL_SCHEME = com.googleusercontent.apps.YOUR_CLIENT_ID_WITHOUT_SUFFIX
SHARE_URL = https://app.example.com/share
BUNDLE_URL_SCHEME = yourapp
BASE_DOMAIN = example.com
ENVIRONMENT_NAME = Staging

Config-Production.xcconfig:

API_BASE_URL = https://api.example.com
SOCKET_BASE_URL = wss://api.example.com
JANUS_SOCKET_URL = wss://api.example.com/janus
APP_API_ID = YOUR_PARTNER_API_ID
APP_API_HASH = YOUR_PARTNER_API_HASH
GOOGLE_CLIENT_ID = YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com
GOOGLE_URL_SCHEME = com.googleusercontent.apps.YOUR_CLIENT_ID_WITHOUT_SUFFIX
SHARE_URL = https://app.example.com/share
BUNDLE_URL_SCHEME = yourapp
BASE_DOMAIN = example.com
ENVIRONMENT_NAME = Production

Entitlements Configuration

Note: Entitlements files cannot use variables directly. You need to manually update:

Production.entitlements / Staging.entitlements

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:app.$(BASE_DOMAIN)</string>
</array>

Manual Update Required: - Replace app.example.com with your domain - Or use build script to generate entitlements dynamically

Accessing Configuration in Code

Swift Code

// Read from Info.plist directly (if needed)
let apiId = Bundle.main.object(forInfoDictionaryKey: "APP_API_ID") as? String
let shareURL = Bundle.main.object(forInfoDictionaryKey: "SHARE_URL") as? String

// Use AppEnvironment / Endpoints helpers (current implementation)
let environment = AppEnvironment.current
environment.printInfo()  // Logs environment information

let baseURL = Endpoints.shared.baseURL
let socketURL = Endpoints.shared.baseSocketURL
let janusURL = Endpoints.shared.baseJanusSocketURL
let googleClientID = Endpoints.shared.googleClientID
let shareUrl = Endpoints.shared.shareURL

Default Values

If variables are not set, defaults are used:

  • SHARE_URL: "https://app.example.com/share"
  • BUNDLE_URL_SCHEME: "yourapp"
  • BASE_DOMAIN: "example.com"
  • ENVIRONMENT_NAME: "Staging"
  • GOOGLE_URL_SCHEME: Computed from GOOGLE_CLIENT_ID

Partner Setup Checklist

For partners setting up their custom application:

  • [ ] Set APP_API_ID with partner API ID
  • [ ] Set APP_API_HASH with partner API hash
  • [ ] Configure API_BASE_URL for your backend
  • [ ] Configure SOCKET_BASE_URL for your WebSocket server
  • [ ] Configure JANUS_SOCKET_URL for your Janus Gateway
  • [ ] Set SHARE_URL if different from default
  • [ ] Set BUNDLE_URL_SCHEME to your custom scheme
  • [ ] Set BASE_DOMAIN to your domain
  • [ ] Configure GOOGLE_CLIENT_ID if using Google Sign-in
  • [ ] Set GOOGLE_URL_SCHEME or let it auto-compute
  • [ ] Update CFBundleDisplayName for app name
  • [ ] Update Entitlements files with your domain
  • [ ] Test all configurations

Security Notes

  1. Never commit actual credentials to version control
  2. Use .gitignore to exclude config files with secrets
  3. Use separate configs for Dev/Staging/Production
  4. Rotate credentials if compromised
  5. Use secure storage for sensitive values

Troubleshooting

Variables not being read

  • Ensure variables are set in Build Settings
  • Check Info.plist has $(VARIABLE_NAME) format
  • Verify build configuration is selected correctly
  • Clean build folder and rebuild

Google URL Scheme issues

  • If GOOGLE_URL_SCHEME not set, it will auto-compute from GOOGLE_CLIENT_ID
  • Ensure format matches: com.googleusercontent.apps.{CLIENT_ID}
  • Verify URL scheme matches in Info.plist

Associated Domains not working

  • Entitlements files must be manually updated
  • Domain must match your backend configuration
  • Verify domain is registered in Apple Developer Portal