Share via


Initialize DAXKit

When the user signs in and is confirmed to have a valid license, your app must initialize DAXKit using the DAX.start() method. This method must be called before you can interact with the DAXKit SDK framework. You can call this method once per app run. It throws an error if it fails to initialize DAXKit.

public static func start(
    withAppMetadataProvider appMetadataProvider: AppMetadataProvider,
    accessTokenProvider: AccessTokenProvider,
    delegate: DAXKitDelegate,
    partnerId: String
)

Parameters

  • appMetadataProvider

    An object that provides information about the app that's using DAXKit.

  • accessTokenProvider

    An object that provides access tokens to communicate with the DAX server.

  • delegate

    The delegate that receives upload events.

  • partnerId

    The partner identifier. This is a fixed GUID assigned by the Dragon partner relations team. For more information about your partner ID, contact the Dragon partner relations team at dragon_partners@microsoft.com.

Protocols

App Metadata Provider

Protocol for a class that provides metadata about the app that's using DAXKit.

@objc public protocol AppMetadataProvider: AnyObject {
    var appID: String { get }
    var appVersion: String { get }
    var deviceID: String { get }
}
  • appID

    The bundle identifier for the app that's using DAXKit.

  • appVersion

    The version of the app that's using DAXKit.

  • deviceID

    A unique identifier for the device. Usually, identifierForVendor is used.

Access Token Provider

Protocol for a class that can provide a valid access token for DAXKit to stream audio to Dragon Copilot. For more information on access tokens, see: Acquiring access tokens.

@objc public protocol AccessTokenProvider: AnyObject {
    func accessToken(onSuccess: @escaping (String) -> Void, onFailure: @escaping (Error) -> Void)
}
  • onSuccess

    The callback that returns the access token if it could be retrieved.

  • onFailure

    The callback that returns an error that retrieving the access token was unsuccessful.