본문으로 건너뛰기

설정

각 기능을 사용하기 전에 로그, Bluetooth 검색, 기기 연결 및 AI 서비스를 설정합니다.

기본 설정

로그 레벨

SDK 초기화에 전달하는 설정에서 로그 레벨을 지정합니다.

Swift
let sdkConfiguration = SDKConfiguration.default()

// Default: .info
// All-in-One uses .verbose only when it creates this configuration for you.
sdkConfiguration.logLevel = .info

let initialized = AIBudsAllInOneSDK.initialize(
    configuration: sdkConfiguration,
    delegate: self
)

guard initialized else {
    print("AIBuds SDK initialization failed.")
    return
}

// Log levels, from most to least verbose:
// .verbose, .debug, .info, .warn, .error, .fatal, .mute

// Modular installation:
// AIBudsSDK.initialize(appDelegate, configuration: sdkConfiguration, delegate: self)

모듈별 초기화 순서는 빠른 시작을 참고하세요.

로그 출력 위치

공유 LogConfiguration에서 로그 출력 위치를 선택합니다.

Swift
let logConfig = LogConfiguration.shared

// Default: .xlfacility
logConfig.destination = .console

// Available destinations:
// .console    — Xcode debugger console
// .oslogger   — Unified logging through os_log
// .file       — SDK-managed files on disk
// .xlfacility — XLFacility plugin

// All-in-One installs the XLFacility plugin automatically.
// Modular integrations must install AIBudsSDK/Log/XLFacility explicitly.

로그 보관, 내보내기 및 정리는 로깅 개요를 참고하세요.

고급 설정

Bluetooth 설정

검색 제한 시간

초기화 전에 기본 제한 시간을 지정하거나 개별 검색에서 값을 재정의합니다.

Swift
// Defaults:
// scanTimeoutInSeconds = 10; use 0 for no automatic timeout.
// shouldAutoReconnectWhenAppLaunch = false
// onlyDiscoverKnownDevices = true
let sdkConfiguration = SDKConfiguration.default()
sdkConfiguration.scanTimeoutInSeconds = 15

// 15 overrides the initialized configuration for this scan only.
AIBudsSDK.startScanning(
    NSNumber(value: 15),
    deviceFoundHandler: { device, isExistingDevice in
        // isExistingDevice is true when an existing result was updated.
    },
    completion: {
        // Called when scanning stops.
    }
)

// Use the timeout supplied during SDK initialization.
AIBudsSDK.startScanning(nil)

연결 매개변수

연결별 값은 ConnectParams로 전달합니다.

Swift
let params = ConnectParams()
params.userId = currentUserId  // Only when required by the integration.
params.randomCode = devicePairingCode  // Only when required by the device.
params.enableClassicBT = true  // Default: true; false enables BLE-only use.
params.aiAuthParams = aiAuthParams  // Only when required by the AI provider.

device.connect(params)

AI 설정

AI 서비스를 설치하고 등록한 뒤 초기화하고, 사용할 서비스를 선택합니다.

Swift
// 1. Install the provider module.
// 2. Register and initialize the provider with AIBudsAISDK.
// 3. Select the registered provider.
AIBudsAISDK.setAIServiceVendor(.starBurst)

// Other public values:
// .mltcloud
// .none       // No provider is selected.

전체 설정 절차는 AI 서비스 선택을 참고하세요.

다음 단계

설정을 마쳤다면 핵심 개념으로 이동하세요. 용어는 SDK 용어집, 기능별 안내는 핵심 기능, 초기화·검색·연결·AI 서비스 선택 문제는 자주 발생하는 문제에서 확인할 수 있습니다.