When the “Automatic Interceptor” is enabled, the SDK will generate an error response when the URL request was blocked or when the challenge was solved/cancelled. You should check the response’s body if it’s one of the SDK’s errors.
You can check the error by using those APIs:
PerimeterX/isRequestBlockedError(error:) - returns true when the request was blocked.PerimeterX/isChallengeSolvedError(error:) - returns true when the request was blocked and the user solved the challenge.PerimeterX/isChallengeCancelledError(error:) - returns true when the request was blocked and the user cancelled the challenge.Here is an example on how to check the error from the response’s body:
When the “Automatic Interceptor” is enabled, the SDK will handle the block response from your server. The SDK will return the following errors to your URL request’s handler:
When the SDK receives the block response from the server it performs the following actions:
block activity in the app, over your other activities.block activity the SDK presents a web view which loads the challenge that must be solved by the user (or the bot).block activity and allow the user to continue working in your app.In Android, there are few cases which the challenge will be cancelled:
After the challenge is cancelled, the user will have to perform the action again. Then, a new challenge will appear. On both iOS and Android, your app should handle the “challenge was cancelled” result.