Skip to content

Lifecycle & Configuration ​

2.1 App startup ​

The SDK self-observes UIApplication.didBecomeActiveNotification / didEnterBackgroundNotification.

swift
import SensorBioSDK
import UIKit

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        // 1. Pin server environment (staging vs production)
        SB_SDK.environment = .production

        // 2. (Optional) restore prior session from keychain
        sensorBio.hydrateSession()

        // 3. (Optional) bridge SDK logs into your own logging pipeline
        SB_SDK.log
            .sink { level, file, function, line, message in
                print("[SDK \(level)] \(message)  (\(file):\(line))")
            }
            .store(in: &cancellables)

        return true
    }
}

2.2 Static configuration knobs ​

swift
extension SB_SDK {
    public static var environment: Environment                                     // .staging | .production
    public static var log: AnyPublisher<(LogLevel, String, String, String, Int), Never>
    public static let version: String                                              // SDK semver
}

extension SB_SDK {
    public enum Environment {
        case staging         // staging server
        case production      // production server (default)
    }
}

Bluetooth SDK license. The underlying Bluetooth SDK license key is bundled inside SB_SDK and is supplied to acquireLicense(_:) internally. There is no integration step for it. A future release will expose a public setter so customer apps can ship their own key.


Sensor Bio Mobile SDK — iOS & Android integration reference.