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:
{ |
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) { |
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
User interface and statusBar style, which is white by default.
Declaration
@property (nonatomic, assign) GTC4UserInterfaceStyle userInterfaceStyle; |
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; |
supportedInterfaceOrientations
The supported interface orientations.
Declaration
@property (assign, nonatomic) UIInterfaceOrientationMask supportedInterfaceOrientations; |
additionalParameter
Additional parameters, which are empty by default. Parameters will be assembled and submitted to the GeeTest.
Declaration
@property (nullable, nonatomic, strong) NSDictionary *additionalParameter; |
Discussion
Supported key-values:
Key | Type | Description | Default Value |
---|---|---|---|
@"loading" |
NSString |
Status indicator of custom loading, the relative path of loading resource of html is loaded by Webview. The empty string refers to cancel the effect of loading | @"./gt4-loading.gif" |
@"rem" |
NSNumber |
Set the overall scaling ratio of the captcha | @(1) |
@"hideBar" |
NSArray<NSString *> * |
Hide the “close” button and “refresh” button. Hides close and refresh button, if set @[@"close", @"refresh"] . |
@[] |
@"nextWidth" |
NSString |
The width of the captcha pop-up window. The unit is needed, such as @”300px”. | nil |
@"riskType" |
NSString |
Conbined with Direct Platform Integration, specify the CAPTCHA form. | nil |
@"hideSuccess" |
NSNumber |
Hide the popup window of verification success. | @(0) |
Sample Code
#define captchaID @"1234567890abcdef" |
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.