Skip to content

Core Auth Get Authenticated Services

Mr.P edited this page Aug 25, 2026 · 2 revisions

View Authorized Services

Read authorizedServices from a connected device.

API Reference

Swift

/// The protocol for device service authentication API.
protocol DeviceServiceAuthAPI: DeviceAPI {
    /// A collection of currently authorized services.
    var authorizedServices: AIBudsAuthorizedServices { get }
}

Objective-C

/// The protocol for device service authentication API.
@protocol AIBudsDeviceServiceAuthAPI <AIBudsDeviceAPI>
/// A collection of currently authorized services.
@property (nonatomic, readonly) AIBudsAuthorizedServices authorizedServices;
@end

The AIBudsAuthorizedServices option set currently defines:

Flag Meaning
AIBudsAuthorizedServicesNone No represented service is authorized.
AIBudsAuthorizedServicesStarBurst StarBurst AI is authorized.
AIBudsAuthorizedServicesOnDeviceVoiceAssistant The on-device voice assistant is authorized.

Usage Examples

Swift

guard let device = device as? DeviceServiceAuthAPI else { return }

let services = device.authorizedServices
let starBurstAuthorized = services.contains(.starBurst)
let voiceAssistantAuthorized = services.contains(.onDeviceVoiceAssistant)

Objective-C

id<AIBudsDeviceServiceAuthAPI> device =
    (id<AIBudsDeviceServiceAuthAPI>)self.device;
if ([device conformsToProtocol:@protocol(AIBudsDeviceServiceAuthAPI)]) {
    AIBudsAuthorizedServices services = device.authorizedServices;
    BOOL starBurstAuthorized = (services & AIBudsAuthorizedServicesStarBurst) != 0;
    BOOL voiceAssistantAuthorized =
        (services & AIBudsAuthorizedServicesOnDeviceVoiceAssistant) != 0;
}

Treat unknown future bits as forward-compatible data and do not reject the complete mask.

AIBuds SDK iOS Wiki

Clone this wiki locally