मुख्य कंटेंट तक स्किप करें

कॉन्फ़िगरेशन

संबंधित SDK सुविधाएँ उपयोग करने से पहले लॉगिंग, 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 सेवा चयन से जुड़ी समस्याओं के लिए सामान्य समस्याएँ देखें।