서비스 인증 재시도
ServiceAuthType에 해당하는 서비스의 인증을 다시 요청합니다.
API 참고
- Swift
- Objective-C
/// 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?
)/// Retries authentication for the specified service.
- (void)retryServiceAuth:(enum AIBudsServiceAuthType)service
completion:(AIBudsCompletionHandler _Nullable)completion;retryServiceAuth를 참고하세요.
| Swift | Objective-C | 서비스 |
|---|---|---|
.starBurst | AIBudsServiceAuthTypeStarBurst | StarBurst AI 서비스 |
.onDeviceVoiceAssistant | AIBudsServiceAuthTypeOnDeviceVoiceAssistant | 오프라인 음성 비서 |
- Swift
- Objective-C
guard let device = device as? DeviceServiceAuthAPI else { return }
device.retryServiceAuth(.starBurst) { success, error in
if !success { print(error?.localizedDescription ?? "Authorization retry failed") }
}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은 재시도 요청의 접수 성공 또는 실패만 나타냅니다. 서비스가 인증되었다고 판단하기 전에 갱신된 인증 상태를 읽거나 SDK 인증 콜백을 처리하세요.