Step 1: Import the Digio module
import DigioEsignSDK
Step 2: Configure Digio instance
DigioBuilder()
.withController(viewController: self) /** Mandatory:- pass your view controller here **/
.setLogo(logo: "") /** Optional:- your logo link **/
.setDocumentId(documentId: "docId") /** Mandatory:- Unique MandateId /Document ID **/
.setIdentifier(identifier: "email/phone") /** Mandatory identifier **/
.setTokenId(tokenId: "") /** Optional: token id to bypass first factor authenticatio**/
.setEnvironment(environment: DigioEnvironment.SANDBOX) /** Mandatory: SANDBOX / PRODUCTION **/
.setServiceMode(serviceMode: DigioServiceMode.OTP) /** Mandatory **/
.setAdditionalParams(additionalParams: additionalParam) /** optional use for eNach/mandate only **/
.build()- Extend DigioEsignDelegate, add onDigioResponseSuccess & onDigioResponseFailure protocol stubs
extension YourViewController : DigioEsignDelegate {
func onDigioResponseSuccess(response: String) {
print("Success \(response)")
}
func onDigioResponseFailure(response: String) {
print("Failure \(response)")
}
func onGatewayEvent(event: String) {
print("Gateway Funnel Event \(event)")
}
}
If you want human-readable crash logs from DigioEsignSDK, please upload the provided dSYM file to your crash reporting service (e.g., Firebase Crashlytics, Sentry).
Note: This is optional. Your app will work fine without it, but crash reports may contain obfuscated stack traces if dSYM is not uploaded.