Skip to main content

Installation

Requirements: iOS 14.0+, Xcode 15.0+, Swift 5.7+ The iOS SDK ships as pre-built frameworks. Add them to your Xcode target:
FrameworkAction
PlaudBleSDK.frameworkEmbed & Sign
PlaudWiFiSDK.frameworkEmbed & Sign
PlaudDeviceBasicSDK.frameworkEmbed & Sign
PlaudDeviceBasicSDK.bundleCopy Bundle Resources
Frameworks are located at sdk/ios/ in the Plaud SDK repo.
SDK frameworks are compiled for arm64 (physical devices only). Simulator is not supported.

Methods

Initialize the Plaud Device SDK to Connect (Bind) Devices

The SDK is initialized with a User Token and your regional domain.
If you haven’t onboarded to the Plaud Developer Platform, see our quickstart onboarding steps.If you’d like more details on how to retrieve your User Token and the token exchange flow, see the Authentication API reference.
import PlaudDeviceBasicSDK

PlaudDeviceAgent.shared.initSDK(
    userAccessToken: "user-token",
    customDomain: "platform-us.plaud.ai"  // domain only, no https://
)
ParameterRequiredDescription
userAccessTokenYesUser Access Token (JWT). Used for device authentication. The handshake token is automatically parsed from the JWT sub field.
customDomainYesServer domain without https:// prefix. All SDK network requests use this domain.
If the User Token is refreshed (e.g., after re-login), you can update it:
PlaudDeviceAgent.shared.setUserAccessToken(newToken)
This automatically updates the handshake token and refreshes the RSA key pair.

Connect to a Plaud Device

PlaudDeviceAgent.shared.delegate = self

PlaudDeviceAgent.shared.startScan()
PlaudDeviceAgent.shared.connectBleDevice(bleDevice: device)

Key Callbacks (PlaudDeviceAgentProtocol)

CallbackDescription
bleScanResult(bleDevices:)Scan results updated
bleConnectState(state:)1 = connected, 0 = disconnected
bleBind(sn:status:...)Device bound successfully
blePenState(state:...)Handshake complete (state = 4099 means recording active)

File Synchronization

// Get file list from device
PlaudDeviceAgent.shared.getFileList(startSessionId: 0)

// Export audio file (supports .pcm, .wav, .opus)
PlaudDeviceAgent.shared.exportAudio(
    sessionId: sessionId,
    outputDir: outputDir,
    format: .opus,
    channels: 1,
    callback: self
)

// Delete file from device
PlaudDeviceAgent.shared.deleteFile(sessionId: sessionId)

WiFi Fast Transfer

Alternative to a BLE (Bluetooth Low Energy) transfer, the Plaud NotePin S can initialize a WiFi Fast Transfer when charging. The WiFi Fast Transfer is ~10x faster than BLE transfers.
Requires the Hotspot Configuration entitlement in your iOS app settings.
PlaudDeviceAgent.shared.setDeviceWiFi(open: true)
// In bleWiFiOpen callback:
PlaudWiFiAgent.shared.bleDevice = BleAgent.shared.bleDevice
PlaudWiFiAgent.shared.connectWifi(ssid, password, 60)
// After wifiHandshake(status: 0):
PlaudWiFiAgent.shared.exportAudioViaWiFi(...)

Firmware Update (OTA)

The Embedded SDK handles the entire OTA flow: version query → download → MD5 verify → CRC → BLE packet push → device restart → reconnect.
// Check for update
PlaudDeviceAgent.shared.checkFirmwareUpdate { result in
    guard result.hasUpdate else { return }
    print("New version: \(result.latestVersion), release notes: \(result.releaseNotes)")
}

// One-call firmware update
PlaudDeviceAgent.shared.startFirmwareUpdate(
    progress: { phase, percentage in
        // phase: .downloading / .installing / .restarting / .complete
        // percentage: 0.0 ~ 1.0
    },
    completion: { result in
        if result.success {
            print("Updated to \(result.version)")
        } else {
            print("Failed: \(result.errorMessage ?? "")")
        }
    }
)
If you already have the firmware file downloaded, use pushFirmwareFile() instead:
PlaudDeviceAgent.shared.pushFirmwareFile(
    filePath: localPath,
    toVersion: "V1.2.8",
    progress: { phase, pct in },
    completion: { result in }
)