Aadhaar QR Scan - Android Native SDK
Enables users to scan the compliant QR code inside their existing Aadhaar card through your custom Android app.
Minimum Requirements
- minSdkVersion 21
- AndroidX
Integration Steps
- Add the following lines to your root
build.gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io"
}
}
}
- Add the following lines to your module-level
build.gradle
android {
...
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
....
implementation 'com.github.Bureau-Inc:aadhaar-qr-scanner-sdk:0.0.1
'
}
- Initializing the SDK and the response returned from the SDK
var scanner = BureauQRScanner.Builder().setCredentialID("YOUR_CREDENTIAL_ID").setDocType(DocType.AADHAAR).setPrompt("YOUR_STRING_TO_DISPLAY").setActivity(this@YourActivity).setEnvironment(ENV_PRODUCTION).build()
scanner.scanQR(object: ScannedDataCallback{
override fun onResult(data : ScannnedData){
data.merchantId
data.referenceId
data.requestId
data.isSuccess
data.errorType
data.errorDescription
}
})
Note
- CredentialId is a mandatory field and should not be empty
- The referenceId from the callback should be recorded.
- Error types are predefined enumerations which will be explained below
- Error Description contains additional error information.
setPrompt()
function is used to set your custom text when scanning is in progress.- The SDK never requests permission but will give a callback if it was not handled by the primary application
SDK Error Types
- CAMERA_PERMISSION_REFUSED,
- SCAN_CANCELLED,
- SCAN_DATA_ERROR,
- API_ERROR
Backend API to Fetch Details
Updated 1 day ago