Every call toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/signing-sdk/face-auth-ios/llms.txt
Use this file to discover all available pages before exploring further.
TadSigningViewController completes through a single trailing closure that receives a TadSigningResult. The result is either a .success with a JWT and a request identifier, or a .failure with a typed error code and a human-readable message. Handling both cases correctly keeps your UI responsive and gives users actionable feedback when something goes wrong.
The TadSigningResult enum
TadSigningResult has two cases:
Success handling
requestId— always present. Use it to correlate the SDK event with a record on your backend.jwt— populated only for.signmode. For.registerit is an empty string. Send the JWT to your server for ES512 signature verification before trusting its claims.
Failure handling
code— a typedTadSigningErrorCodeenum value. Access the underlying string identifier with.rawValuefor logging or display.message— a human-readable description of the error, suitable for logging. Do not display raw error messages directly to end users; map them to localized, user-friendly strings in your UI layer.
Access the string representation of an error code with
code.rawValue. The enum type gives you compile-time safety when switching over known cases, while .rawValue is useful for logging and analytics.Complete result handler
The following is the complete switch statement from the demo app, showing both cases together:Loading state management
Use a boolean state variable to track whether the SDK is active. Set it totrue before presenting and back to false in the completion closure — in both the success and failure branches.
isLoading is true to prevent the user from triggering a second SDK session before the first one completes:
Best practices
- Always handle both cases. A non-exhaustive switch will cause a compile error in Swift, but ensure your UI recovers gracefully from every failure path rather than silently ignoring errors.
- Map error codes to localized messages. Use
code.rawValueto look up user-facing strings in your localization table rather than surfacing SDK-internal error text directly. - Log failures with context. Include
code.rawValue,message, thebankId(or a hashed version), and themodein your logging pipeline to aid debugging. - Do not block the main thread. Keep the closure body lightweight; dispatch any network or persistence work off the main queue.