Aadhaar QR Scan - Ionic SDK
Enables users to scan the compliant QR code inside their existing Aadhaar card through your custom Android app. It further allows you to integrate Aadhaar-QR SDK code functionality into your Ionic applications. The
SDK is based on the Ionic Framework with AngularJS support and is designed for Android platforms.
Libraries Used
- Ionic Framework with Cordova
- AngularJS Support
NPM Package Link
https://www.npmjs.com/package/bureau-aadhaar-qr-sdk
Installation
- Installing the package
npm install "bureau-aadhaar-qr-sdk"
- Import the SDK in your application
import { BureauAadhaarQRSDK } from bureau-aadhaar-qr-sdk
- Initializing the SDK in your home.page.js/ts
import { BureauAadhaarQRSDK } from bureau-aadhaar-qr-sdk @Component({
selector: 'app-home'
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
async startScanner() {
const result = await BureauAadhaarQRSDK.startScan();
alert(result.content); //The QR content will come out here
//Handle the data as your heart desires here
} else {
alert('NO DATA FOUND!');
}
For this change src/app/home/home.page.html
Unset
<ion-header>
<ion-toolbar>
<ion-title>Barcode Scanner</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-button (click)="startScan()"></ion-button>
</ion-content>
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
'
}
Note
- CredentialId is a mandatory field and should not be empty
- The referenceId from the callback should be recorded.
Backend API to Fetch Details
Updated 3 days ago