Skip to content

Commit

Permalink
missing iOS check
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Oct 14, 2023
1 parent 8c3d41b commit e049c5f
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions FirebaseAuth/Sources/Swift/Auth/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1431,42 +1431,44 @@ extension Auth: AuthInterop {
return false
}

/** @fn initializeRecaptchaConfigWithCompletion:completion:
@brief Initializes reCAPTCHA using the settings configured for the project or
tenant.
#if os(iOS)
/** @fn initializeRecaptchaConfigWithCompletion:completion:
@brief Initializes reCAPTCHA using the settings configured for the project or
tenant.

If you change the tenant ID of the `Auth` instance, the configuration will be
reloaded.
*/
@objc(initializeRecaptchaConfigWithCompletion:)
public func initializeRecaptchaConfig(completion: ((Error?) -> Void)?) {
Task {
do {
try await initializeRecaptchaConfig()
if let completion {
completion(nil)
}
} catch {
if let completion {
completion(error)
If you change the tenant ID of the `Auth` instance, the configuration will be
reloaded.
*/
@objc(initializeRecaptchaConfigWithCompletion:)
public func initializeRecaptchaConfig(completion: ((Error?) -> Void)?) {
Task {
do {
try await initializeRecaptchaConfig()
if let completion {
completion(nil)
}
} catch {
if let completion {
completion(error)
}
}
}
}
}

/** @fn initializeRecaptchaConfig
@brief Initializes reCAPTCHA using the settings configured for the project or
tenant.
/** @fn initializeRecaptchaConfig
@brief Initializes reCAPTCHA using the settings configured for the project or
tenant.

If you change the tenant ID of the `Auth` instance, the configuration will be
reloaded.
*/
public func initializeRecaptchaConfig() async throws {
// Trigger recaptcha verification flow to initialize the recaptcha client and
// config. Recaptcha token will be returned.
let verifier = AuthRecaptchaVerifier.shared(auth: self)
let _ = try await verifier.verify(forceRefresh: true, action: AuthRecaptchaAction.defaultAction)
}
If you change the tenant ID of the `Auth` instance, the configuration will be
reloaded.
*/
public func initializeRecaptchaConfig() async throws {
// Trigger recaptcha verification flow to initialize the recaptcha client and
// config. Recaptcha token will be returned.
let verifier = AuthRecaptchaVerifier.shared(auth: self)
_ = try await verifier.verify(forceRefresh: true, action: AuthRecaptchaAction.defaultAction)
}
#endif

/** @fn addAuthStateDidChangeListener:
@brief Registers a block as an "auth state did change" listener. To be invoked when:
Expand Down Expand Up @@ -2415,7 +2417,6 @@ extension Auth: AuthInterop {
}

#if os(iOS)

private func wrapInjectRecaptcha<T: AuthRPCRequest>(request: T,
action: AuthRecaptchaAction,
_ callback: @escaping (
Expand Down

0 comments on commit e049c5f

Please sign in to comment.