# RecaptchaEnterprise Framework Reference

# RecaptchaClient

    @interface RecaptchaClient : NSObject

Interface to interact with reCAPTCHA.
- `


  ### [-execute:withTimeout:completion:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient#/c:objc(cs)RecaptchaClient(im)execute:withTimeout:completion:)


  ` 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: https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html, withTimeout timeout: Double) async throws -> String

  Objective-C

      - (void)execute:(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html *_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. |

- `


  ### [-execute:completion:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient#/c:objc(cs)RecaptchaClient(im)execute:completion:)


  ` Executes reCAPTCHA on a user action.

  This method throws a timeout exception after 10 seconds.

  #### Declaration

  Swift

      func execute(withAction action: https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html) async throws -> String

  Objective-C

      - (void)execute:(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html *_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 APIs and properties.](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient#/Deprecated-APIs-and-properties.)

- `


  ### [-execute:completionHandler:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient#/c:objc(cs)RecaptchaClient(im)execute:completionHandler:)


  ` 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: https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html) async -> (https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaToken.html?, https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaError.html?)

  Objective-C

      - (void)execute:(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaAction.html *_Nonnull)action
          completionHandler:
              (nonnull void (^)(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaToken.html *_Nullable,
                                https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaError.html *_Nullable))completionHandler;

  #### Parameters

  |---|---|
  | ` action ` | The user action to protect. |
  | ` completionHandler ` | Callback function to return the execute result. |