HSBotDefender

Properties

Link copied to clipboard

Functions

Link copied to clipboard

This function checks if the SDK can handle the URL request's response and presents the block screen. Returns true if the Human's payload in the response can be handled by the SDK. This function does not present the block screen. You must call the start(appId:delegate:completion:) function and wait until it's done before calling this function

Link copied to clipboard

Returns the challenge's Reference ID. This value will appear in the challenge screen. The value is unique per app run. Meaning, for each challenge in the app run the value will be the same for all challenges. Note that the value in the challenge screen will be different from the returned value when:

Link copied to clipboard

Returns a JSON string that represent the given error type. When the automatic interceptor is enabled, the body of the URL response will be the same as the string that returns here. When the automatic interceptor is disabled, you may replace the original URL response with the string that returns here.

Link copied to clipboard

Returns the relevant `HSBotDefenderErrorType` of the given error. When policy type is set to PXPolicyUrlRequestInterceptionType/INTERCEPT you can use this function to know if the request was blocked. When policy type is set to PXPolicyUrlRequestInterceptionType/INTERCEPT_WITH_DELAY you can use this function with the response to know if the request was solved or cancelled. If the error is not related, this function will return `HSBotDefenderErrorType/unknown`.

Link copied to clipboard
fun handleResponse(response: String, callback: (result: HSBotDefenderChallengeResult) -> Unit?): Boolean

This function handles the URL request's response and presents the block screen, if necessary. Returns true if the Human's payload in the response was handled by the SDK. This function should be used only when the `PXPolicyUrlRequestInterceptionType` is set to `PXPolicyUrlRequestInterceptionType/NONE` in the policy.

Link copied to clipboard

Returns HTTP headers that should be added to the URL request. This function should be used only when the `PXPolicy/urlRequestInterceptionType` is set to `PXPolicyUrlRequestInterceptionType/NONE`.

Link copied to clipboard
fun setCustomParameters(parameters: HashMap<String, String>, appId: String?)

Set custom parameters for given AppID.