How to Integrate?
- On terminal, cd to your Xcode project root directory (where your .xcodeproj file)
- pod init : This will create a podfile.
- Add the following line to your podfile
- pod 'DigioEsignSDK'
- pod install
- Close all session of xcode projects and open your project again.
Create SDK configuration
1. Import the Digio module
import DigioEsignSDK
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 authentication
.setEnvironment(environment: DigioEnvironment.SANDBOX) // Mandatory: SANDBOX / PRODUCTION
.setServiceMode(serviceMode: DigioServiceMode.OTP) // Mandatory
.setAdditionalParams(additionalParams: additionalParam) // optional use for eNach/mandate only
.build()
3. Handle SDK response
- Implement DigioEsignDelegate, add onDigioResponseSuccess & onDigioResponseFailure protocol stubs
extension YourViewController : DigioEsignDelegate {
func onDigioResponseSuccess(response: String) {
print("Success \(response)")
}
func onDigioResponseFailure(response: String) {
print("Failure \(response)")
}
}
- GatewayEventResponse
{
"txnId": "2.5601690357804383",
"documentId": "DID230303132625594XWVBSZBSZO7ZXS",
"event": "esign.initiated",
"identifier": "email@domain.com",
"entity": "esign"
}
- Sample Response
{
"id": "ENA210614175731616Y1YFFC9V1J83AP",
"status": "success",
"npci_txn_id": "8cff752e65c549f2b4e0906cd5e35d3a",
"message": "Process completed",
"code": "1001"
}
{
"status": "failure",
"id": "ENA210614175731616Y1YFFC9V1J83AP",
"message": "failure",
"code": "1002"
}
{
"id": "DID210614171836976GQ4VZ2SEINQ9Y8",
"message": "Cancelled by user",
"status": "cancel",
“code”: “-1000”
}
- Cancel case
- Failure case
- Success case
Version Details below
- Platform = ios
- Ios.deployment_target = 12.0
- Swift_version = 5.7.2
- Xcode_version = 16.2