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:| Framework | Action |
|---|---|
PlaudBleSDK.framework | Embed & Sign |
PlaudWiFiSDK.framework | Embed & Sign |
PlaudDeviceBasicSDK.framework | Embed & Sign |
PlaudDeviceBasicSDK.bundle | Copy Bundle Resources |
sdk/ios/ in the Plaud SDK repo.
SDK frameworks are compiled for
arm64 (physical devices only). Simulator is not supported.Methods
Plaud Device SDK Initialization
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.
Swift
User Access Token (JWT), used for device authentication. The handshake token is automatically parsed from the JWT
sub field.Your regional Plaud server domain without
https:// prefix. All SDK network requests use this domain.For more information on how to find your regional server domain, see the Authentication API docs.Refreshing User Token
If the User Token is refreshed (e.g., after re-login), you can update it:Swift
Refreshed User Token (JWT)
Connecting (binding) to a Plaud Device
The.startScan() will call the bleScanResult callback defined in the PlaudDeviceAgentProtocol
Swift
A scanned/connected device
If needed, a unique identifier for that device
PlaudDeviceAgentProtocol Callbacks
The PlaudDeviceAgentProtocol is a delegate protocol with a few key callbacks for the PlaudDeviceAgent. See the Protocols section for the full list of callbacks.| Callback | Description |
|---|---|
bleScanResult(bleDevices: [BleDevice]) | Scan results updated |
bleConnectState(state: Int) | 1 = connected, 0 = disconnected |
bleBind(sn:status:protVersion:timezone:) | Binding status updated |
blePenState(state:privacy:keyState:uDisk:findMyToken:hasSndpKey:deviceAccessToken:) | Device state changed |
File Synchronization
TheexportAudio method exports audio files from Plaud device to your users’ phone, reporting progress through the AudioExportCallback. The .getFileList accesses files on your users’ Plaud device, and the .deleteFile method will delete an audio file off of your users’ Plaud device.
Swift
Session ID
Output Directory
.opus | .mp3 | .wav | .pcm
pcm = 0, mp3 = 1, wav = 2, opus = 3
See AudioExportCallback for details.func onProgress(_ progress: Int, message: String)func onComplete(outputPath: String)func onError(_ error: String)
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.Protocol Callbacks
The WiFi Fast Transfer has two key callbacks, one on the PlaudDeviceAgentProtocol and another on the AudioExportCallback.| Protocol | Callback | Description |
|---|---|---|
| PlaudDeviceAgent Protocol | bleWiFiOpen(_ status: Int, _ wifiName: String, _ wholeName: String, _ wifiPass: String) | Called when Plaud device opens hotspot |
| AudioExportCallback | onComplete | Called when a file has downloaded |
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 Firmware Updates
Swift
Callback function with type PlaudFirmwareCheckResult
Download Firmware Update
Swift
Callback that reports firmware update progress.
phase: Current phase of the update (PlaudFirmwarePhase)percentage: Progress from 0.0 to 1.0
Callback when the update completes.
pushFirmwareFile() instead:
Push Firmware Update
Swift
Full path to the locally downloaded firmware file
Target firmware version to update to (e.g., “V1.2.8”)
Callback that reports firmware update progress.
phase: Current phase (downloading/installing/restarting/complete)percentage: Progress from 0.0 to 1.0
Callback when the update completes with
success, version, and errorMessage fields.Protocols
The Embedded SDK is delegate-driven. You implement protocols and assign yourself as the delegate to receive device events, transfer progress, and results. These three protocols should cover most use cases.Most callbacks are delivered on the SDK’s internal dispatch queues — not the main thread. Marshal to the main queue before touching UIKit or published state.
PlaudDeviceAgentProtocol
The primary delegate forPlaudDeviceAgent. Assign it once and it drives the entire BLE lifecycle — scan, connect, bind, device state, recording, and file sync.
Swift
blePenState is the only required member. Every other callback is @objc optional — implement only the ones you need.| Group | Callback | Description |
|---|---|---|
| Connection | blePenState(...) | Required. Device state reported after the handshake completes |
| Connection | bleConnectState(state: Int) | 1 = connected, 0 = disconnected |
| Connection | bleScanResult(bleDevices: [BleDevice]) | Scan results updated |
| Connection | bleScanOverTime() | Scan timed out with no results |
| Connection | bleBind(sn:status:protVersion:timezone:) | Binding status updated |
| Device state | bleStorage(total: Int, free: Int, duration: Int) | Storage usage on the device |
| Device state | bleChargingState(isCharging: Bool, level: Int) | Charging / battery level changed |
| Recording | bleRecordStart(sessionId:start:status:scene:startTime:reason:) | Recording started |
| Recording | bleRecordStop(sessionId:reason:fileExist:fileSize:) | Recording stopped |
| Recording | blePcmData(sessionId:millsec:pcmData:isMusic:) | Live PCM chunks for waveform / metering |
| File sync | bleFileList(bleFiles: [BleFile]) | Result of getFileList(...) |
| File sync | bleData(sessionId: Int, start: Int, data: Data) | A chunk of file data during sync |
| File sync | bleDataComplete() | File transfer finished |
| File sync | bleDeleteFile(sessionId: Int, status: Int) | Result of deleteFile(...) |
| WiFi | bleWiFiOpen(_ status: Int, _ wifiName: String, _ wholeName: String, _ wifiPass: String) | Device opened its hotspot — hand off to PlaudWiFiAgent |
| OTA | bleFotaResult(uid: Int, status: Int, errmsg: String?) | Firmware push result |
The SDK also exposes a lower-level
BleAgentProtocol on BleAgent with 60+ required callbacks. Prefer PlaudDeviceAgentProtocol — the facade handles the handshake, decryption, and format conversion for you, and lets you implement only the callbacks you care about.AudioExportCallback
Reports progress, completion, and errors for.exportAudio (BLE) and .exportAudioViaWiFi (WiFi).
Swift
Export progress,
0–100, with a human-readable status message.Called when decoding finishes;
outputPath is the full path to the written file.Called if export fails, with a description of the error.
PlaudWiFiAgentProtocol
The delegate forPlaudWiFiAgent, used during WiFi Fast Transfer. Assign it before calling connectWifi(...). The handshake must complete (wifiHandshake with status 0) before listing or transferring files.
Swift
@objc optional.
| Callback | Description |
|---|---|
wifiHandshake(_ status: Int) | 0 = handshake complete, ready to list/transfer |
wifiConnectionStatus(_ ssid: String, _ connected: Bool) | WiFi connection state changed |
wifiFileList(_ files: [BleFile]) | Result of getFileList(...) over WiFi |
wifiSyncFileData(_ sessionId:_ offset:_ count:_ binData:) | A chunk of file data |
wifiDataComplete() | Single-file transfer finished |
wifiDownloadAllProgress(_ totalFiles:_ currentFileIndex:_ currentFile:_ totalProgress:) | Progress while downloading all files |
wifiDownloadAllCompleted(_ completedFiles: Int, _ failedFiles: Int) | Batch download finished |
wifiCommonErr(_ cmd: Int, _ status: Int) | A command failed |
wifiClose(_ status: Int) | WiFi transfer session closed |
WiFi Fast Transfer requires the
Hotspot Configuration entitlement in your app. See WiFi Fast Transfer for the full connect-and-transfer flow.