Skip to main content

Initialize the SDK

In your AppDelegate.swift or App.swift file, import and initialize the SDK:
import UIKit
import AppPanel

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        // Initialize AppPanel SDK with different keys for debug/release
        #if DEBUG
        let apiKey = "placeholder_debug_key"
        #else
        let apiKey = "placeholder_production_key"
        #endif
        AppPanel.configure(apiKey: apiKey)

        return true
    }
}

Get Your API Keys

  1. Log in to your AppPanel Dashboard
  2. Navigate to the project you are setting up the SDK for
  3. Navigate to Settings ▸ Project ▸ API Keys
  4. Copy your development and production public key
API Keys in dashboard
  1. Replace the placeholder keys in the code above with your actual keys
Using separate keys for debug and release builds helps you test without affecting production data. Your test key will be used during development, and your live key will be used in the App Store build.