Use the Mentra Bluetooth SDK from a native iOS app.
Native iOS apps use the MentraBluetoothSDK Swift package.The same package also supports native macOS with AppKit or SwiftUI.
The permissions and background modes below apply to iOS, including iOS apps
running on Apple silicon Macs. Native Mac apps use the separate macOS setup.
In Xcode, choose File > Add Package Dependencies, enter that URL, select version 3.3.0-beta.1098, and add the MentraBluetoothSDK product to your app target.For Package.swift consumers:
<key>NSBluetoothAlwaysUsageDescription</key><string>This app connects to your smart glasses over Bluetooth.</string><key>NSMicrophoneUsageDescription</key><string>This app uses the microphone when you enable audio features.</string><key>NSLocalNetworkUsageDescription</key><string>This app can connect to optional local demo servers on your network.</string>
Declare Core Bluetooth background mode in your app’s Info.plist. It is required, not optional: iOS reads background modes only from the app’s own Info.plist, so the Swift package cannot add it for you.
Mentra Live drops its Bluetooth link for short periods in normal use. During a software update, the glasses restart their Bluetooth chip and are unreachable for about 45 seconds; walking out of range or powering the glasses off has the same effect. When the link drops, the SDK keeps a pending connection to the same glasses open, and iOS completes it as soon as they advertise again. With bluetooth-central, iOS completes that reconnection and wakes your app even while the phone is locked in a pocket. Without it, iOS suspends your app and nothing reconnects until the user opens it again, so a software update started on a locked phone stalls after the Bluetooth chip restarts.App Review asks apps that declare bluetooth-central to need it; a companion app for connected glasses does.At startup the SDK checks your Info.plist and logs a warning when bluetooth-central is missing. Read MentraBluetoothSDK.supportsBackgroundReconnect to check it from code, for example in a debug assertion or a setup screen.If your app also keeps microphone capture or an audio session active in the background, add audio as well:
Configure your AVAudioSession before starting continuous microphone or playback work. Start continuous microphone capture while the app is foregrounded; iOS background mode lets an active session continue, but the SDK does not start the phone microphone from the background. For example:
bluetooth-central lets iOS deliver BLE events to your app and complete its pending reconnection in the background, subject to iOS scheduling and power-management limits. audio is required only for apps that intentionally keep recording or audio playback active after backgrounding.
This SDK version does not enable terminated-app Core Bluetooth state restoration with CBCentralManagerOptionRestoreIdentifierKey. If iOS terminates the app, relaunch the app and reconnect from your normal startup flow.