Skip to content

Core Auth Retry Auth

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

Retry Service Authorization

Request another authorization attempt for a ServiceAuthType.

API Reference

Swift

/// Retries authentication for the specified service.
/// - Parameters:
///   - service: The service whose authentication should be retried.
///   - completion: A closure that is called when the operation completes.
///     - success: `true` if the operation was successful; otherwise `false`.
///     - error: An `NSError` object that describes the error that occurred, or `nil` if the operation was successful.
func retryServiceAuth(
    _ service: ServiceAuthType,
    completion: AIBudsCompletionHandler?
)

Objective-C

/// Retries authentication for the specified service.
- (void)retryServiceAuth:(enum AIBudsServiceAuthType)service
              completion:(AIBudsCompletionHandler _Nullable)completion;

See retryServiceAuth.

Swift Objective-C Service
.starBurst AIBudsServiceAuthTypeStarBurst StarBurst AI
.onDeviceVoiceAssistant AIBudsServiceAuthTypeOnDeviceVoiceAssistant On-device voice assistant

Swift

guard let device = device as? DeviceServiceAuthAPI else { return }
device.retryServiceAuth(.starBurst) { success, error in
    if !success { print(error?.localizedDescription ?? "Authorization retry failed") }
}

Objective-C

id<AIBudsDeviceServiceAuthAPI> device = (id<AIBudsDeviceServiceAuthAPI>)self.device;
if ([device conformsToProtocol:@protocol(AIBudsDeviceServiceAuthAPI)]) {
    [device retryServiceAuth:AIBudsServiceAuthTypeStarBurst
                  completion:^(BOOL success, NSError *error) {
                      if (!success) {
                          NSLog(@"%@", error.localizedDescription);
                      }
                  }];
}

Completion means the retry request was accepted or failed; read updated authorization state or handle SDK authorization callbacks before declaring the service authorized.

AIBuds SDK iOS Wiki

Clone this wiki locally