RecaptchaClient
@interface RecaptchaClient : NSObject
Interface to interact with reCAPTCHA.
-
Executes reCAPTCHA on a user action.
It is suggested the usage of 10 seconds for the timeout. The minimum value is 5 seconds.
Declaration
Swift
func execute(withAction action: RecaptchaAction, withTimeout timeout: Double) async throws -> String
Objective-C
- (void)execute:(RecaptchaAction *_Nonnull)action withTimeout:(double)timeout completion: (nonnull void (^)(NSString *_Nullable, NSError *_Nullable))completion;
Parameters
action
The user action to protect.
timeout
Timeout for execute in milliseconds.
completion
Callback function to return the execute result.
-
Executes reCAPTCHA on a user action.
This method throws a timeout exception after 10 seconds.
Declaration
Swift
func execute(withAction action: RecaptchaAction) async throws -> String
Objective-C
- (void)execute:(RecaptchaAction *_Nonnull)action completion: (nonnull void (^)(NSString *_Nullable, NSError *_Nullable))completion;
Parameters
action
The user action to protect.
completion
Callback function to return the execute result.
-
Deprecated
Use method execute(withTimeout:completionHandler) instead
Executes reCAPTCHA on a user action.
This method throws a timeout exception after 10 seconds.
Declaration
Swift
func execute(_ action: RecaptchaAction) async -> (RecaptchaToken?, RecaptchaError?)
Objective-C
- (void)execute:(RecaptchaAction *_Nonnull)action completionHandler: (nonnull void (^)(RecaptchaToken *_Nullable, RecaptchaError *_Nullable))completionHandler;
Parameters
action
The user action to protect.
completionHandler
Callback function to return the execute result.