Ana içeriğe geç

Hizmet Yetkilendirmesini Yeniden Deneme

Bir ServiceAuthType değeri için yeni bir yetkilendirme denemesi isteyin.

API Referansı

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?
)

Bkz. retryServiceAuth.

SwiftObjective-CHizmet
.starBurstAIBudsServiceAuthTypeStarBurstStarBurst AI hizmeti
.onDeviceVoiceAssistantAIBudsServiceAuthTypeOnDeviceVoiceAssistantCihaz üzerindeki sesli asistan
Swift
guard let device = device as? DeviceServiceAuthAPI else { return }
device.retryServiceAuth(.starBurst) { success, error in
    if !success { print(error?.localizedDescription ?? "Authorization retry failed") }
}

Completion sonucu yalnızca yeniden deneme isteğinin kabul edildiğini veya başarısız olduğunu gösterir. Hizmeti yetkilendirilmiş saymadan önce güncel yetkilendirme durumunu okuyun ya da SDK yetkilendirme callback'lerini işleyin.