Aadhaar QR Scan SDK - Ionic

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 Ionic Framework with AngularJS support and is designed for Android platforms.

NPM Package Link

  https://www.npmjs.com/package/bureau-aadhaar-qr-sdk

Installation

  1. Installing the package
   npm install "bureau-aadhaar-qr-sdk"
  1. Import the SDK in your application
import { BureauAadhaarQRSDK } from bureau-aadhaar-qr-sdk
  1. 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 following lines in 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
'
}

Notes

  1. CredentialId is a mandatory field and should not be empty
  2. The referenceId from the callback should be recorded.

Library Used

  1. Ionic Framework with Cordova
  2. AngularJS Support

Backend API to fetch the details

Link to backend API