iOS
GTCaptcha4SessionTaskDelegate
Captcha Session Task Delegate
gtCaptchaSession:didReceive:result:
Callback result parameters of captcha session.
Declaration
- (void)gtCaptchaSession:(GTCaptcha4Session *)captchaSession |
Parameters
Param | Description |
---|---|
captchaSession | Captcha session |
status | Status code. @ “0”/@ “1”: Not finished/finished. When status is @ “1”, it is successful, and the result needs to be secondary validated. |
result | Result verification parameters. |
Discussion
After getting the parameters of verification results, they need to be submitted to the business server to complete the verification of parameters.
Result sample:
{ "challenge" : "19080ae5-fe79-4431-9c78-4ee8e0dec798", "captcha_id" : "c62d0f270240799b3113b0a5787ead55"} |
gtCaptchaSession:didReceiveError:
Callback errors that occurred in the captcha session.
Declaration
- (void)gtCaptchaSession:(GTCaptcha4Session *)captchaSession |
Parameters
Param | Description |
---|---|
captchaSession | Captcha session |
error | Error description object |
See also GTC4Error
GTCaptcha4Session
Captcha session
delegate
Captcha session task delegate.
Declaration
@property (nonatomic, weak) id<GTCaptcha4SessionTaskDelegate> delegate; |
captchaID
The captcha ID of the current captcha session.
Declaration
@property (nonnull, readonly, nonatomic, strong) NSString *captchaID; |
challenge
The serial number of the current captcha session.
Declaration
@property (nullable, readonly, nonatomic, strong) NSString *challenge; |
configuration
Configuration of the current captcha session.
Declaration
@property (nonnull, readonly, nonatomic, strong) GTCaptcha4SessionConfiguration *configuration; |
sessionWithCaptchaID:
Create a new captcha session instance.
Declaration
+ (instancetype)sessionWithCaptchaID:(NSString *)captchaID; |
Parameters
Param | Description |
---|---|
captchaID | Captcha ID |
Return Value is a new GTCaptcha4Session
instance
sessionWithCaptchaID:configuration:
Create a new captcha session instance.
Declaration
+ (instancetype)sessionWithCaptchaID:(NSString *)captchaID |
Param | Description |
---|---|
captchaID | Captcha ID |
configuration | Configure session |
Return Value is a new GTCaptcha4Session instance
initWithCaptchaID:
Create a new captcha session instance.
Declaration
- (instancetype)initWithCaptchaID:(NSString *)captchaID; |
Param | Description |
---|---|
captchaID | Captcha ID |
Return Value is a new GTCaptcha4Session instance
initWithCaptchaID:configuration:
Create a new captcha session instance.
Declaration
- (instancetype)initWithCaptchaID:(NSString *)captchaID |
Param | Description |
---|---|
captchaID | Captcha ID |
configuration | Configure session |
Return Value is a new GTCaptcha4Session instance
verify
Start verification
Declaration
- (void)verify; |
cancel
Cancel verification
Declaration
- (void)verify; |
sdkVersion
Obtain the SDK version number.
Declaration
+ (NSString *)sdkVersion; |
GTCaptcha4SessionConfiguration
Captcha session configuration
GTC4UserInterfaceStyle
Verify the interface style.
Declaration
typedef NS_ENUM(NSInteger, GTC4UserInterfaceStyle) { |
GTC4DisplayStyle
Captcha Display Style
Declaration
typedef NS_ENUM(NSInteger, GTC4DisplayStyle) { |
resourcePath
The full path of remote access to static resources, which is empty by default.
Declaration
@property (nullable, nonatomic, strong) NSString *resourcePath; |
protocol
Protocol for remote access to static resources, default is @ “https”.
Declaration
@property (nonatomic, strong) NSString *protocol; |
userInterfaceStyle
Interface style is white by default.
Declaration
@property (nonatomic, assign) GTC4UserInterfaceStyle userInterfaceStyle; |
displayStyle
The display style of the interface is centered by default.
Declaration
@property (nonatomic, assign) GTC4DisplayStyle displayStyle; |
backgroundColor
The background color is transparent by default.
Declaration
@property (nonatomic, strong) UIColor *backgroundColor; |
debugEnable
Debug is disabled by default.
Declaration
@property (nonatomic, assign) BOOL debugEnable; |
backgroundUserInteractionEnable
Background user interaction is enabled by default.
Declaration
@property (nonatomic, assign) BOOL backgroundUserInteractionEnable; |
timeout
Request timeout is 8 seconds by default.
Declaration
@property (nonatomic, assign) NSTimeInterval timeout; |
language
Language is the system language by default. Please refer to the language short code for setting the language.
Declaration
@property (nonatomic, strong) NSString *language; |
additionalParameter
Additional parameters, which are empty by default. Parameters will be assembled and submitted to the GeeTest.
Declaration
@property (nullable, nonatomic, strong) NSDictionary *additionalParameter; |
defaultConfiguration
Get a default configuration.
Declaration
+ (GTCaptcha4SessionConfiguration *)defaultConfiguration; |
Return Value
+ (GTCaptcha4SessionConfiguration *)defaultConfiguration { |
GTC4Error
Error description object
/// Illegal parameter. Please check the parameters you entered. |
code
Error code, and can be used for matching processing.
Declaration
@property (readonly, nonatomic, strong) NSString *code; |
See also the error code list above
msg
Error message which can be used to display on user interface.
Declaration
@property (readonly, nonatomic, strong) NSString *msg; |
desc
Detailed description of the error, which is used to troubleshoot problems in detail.
Declaration
@property (readonly, nonatomic, strong) NSDictionary *desc; |
Discussion
Support users’ operational problems with captcha.