Recaptcha
@interface Recaptcha : NSObjectInterface to interact with reCAPTCHA.
-
Builds a new reCAPTCHA Client for the given Site Key and timeout.
The SDK supports one Site Key. Passing a different Site Key will throw an exception.
Declaration
Swift
class func fetchClient(withSiteKey siteKey: String) async throws -> RecaptchaClientObjective-C
+ (void)fetchClientWithSiteKey:(nonnull NSString *)siteKey completion:(nonnull void (^)(RecaptchaClient *_Nullable, NSError *_Nullable))completion;Parameters
siteKeyreCAPTCHA Site Key for the app.
completionCallback function to return the RecaptchaClient or an error.
-
Builds a new reCAPTCHA Client for the given Site Key and timeout.
The SDK supports one Site Key. Passing a different Site Key will throw an exception.
At least a 10000 millisecond timeout is suggested to allow for slow networking, though in some cases longer timeouts may be necessary. The minimum allowable value is 5000 milliseconds.
Declaration
Swift
class func getClient(withSiteKey siteKey: String, withTimeout timeout: Double) async throws -> RecaptchaClientObjective-C
+ (void)getClientWithSiteKey:(nonnull NSString *)siteKey withTimeout:(double)timeout completion:(nonnull void (^)(RecaptchaClient *_Nullable, NSError *_Nullable))completion;Parameters
siteKeyreCAPTCHA Site Key for the app.
timeoutTimeout for getClient in milliseconds.
completionCallback function to return the RecaptchaClient or an error.
-
Builds a new reCAPTCHA Client for the given Site Key.
The SDK supports one Site Key. Passing a different Site Key will throw an exception.
This method will timeout after 10 seconds.
Declaration
Swift
class func getClient(withSiteKey siteKey: String) async throws -> RecaptchaClientObjective-C
+ (void)getClientWithSiteKey:(nonnull NSString *)siteKey completion:(nonnull void (^)(RecaptchaClient *_Nullable, NSError *_Nullable))completion;Parameters
siteKeyreCAPTCHA Site Key for the app.
completionCallback function to return the RecaptchaClient or an error.
-
Deprecated
Use the new method getClient(withSiteKey:timeout:completion:)
Builds a new reCAPTCHA Client for the given SiteKey.
This method will timeout after 10 seconds.
Declaration
Swift
class func getClient(siteKey: String) async -> (RecaptchaClient?, RecaptchaError?)Objective-C
+ (void)getClientWithSiteKey:(nonnull NSString *)siteKey completionHandler: (nonnull void (^)(RecaptchaClient *_Nullable, RecaptchaError *_Nullable))completionHandler;Parameters
siteKeyreCAPTCHA Site Key for the app.
completionHandlerCallback function to return the RecaptchaClient or an error.