mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 15:18:18 -05:00
* add iOS qrcode opener and aadhaar screen * format * fix test * add Image-picker android (#1077) * add image-picker android * fix validation * feat: implement Aadhaar upload success and error screens, enhance AadhaarNavBar with dynamic progress indication - Added AadhaarUploadedSuccessScreen and AadhaarUploadErrorScreen components for handling upload outcomes. - Updated AadhaarNavBar to reflect current upload step with dynamic progress bar. - Integrated new screens into navigation flow for Aadhaar upload process. - Introduced blue check and warning SVG icons for visual feedback on success and error states. * feat: generate mock aadhar (#1083) * feat: generate mock aadhar * add yarn.lock * update yarn.lock * update protocolStore, update types, start modifying provingMachine * Register mock aadhar (#1093) * Register mock aadhar * fix ofac * temp: generate name * fix dob * Add Aadhaar support to ID card component and screens - Integrated Aadhaar icon and conditional rendering in IdCardLayout. - Updated AadhaarUploadScreen to process QR codes and store Aadhaar data. - Modified navigation and button text in AadhaarUploadedSuccessScreen. - Added mock data generation for Aadhaar in the mobile SDK. - Updated ManageDocumentsScreen to include Aadhaar document type. - Enhanced error handling and validation for Aadhaar QR code processing. - Added utility functions for Aadhaar data extraction and commitment processing. * aadhaar disclose - wip (#1094) * fix: timestamp cal of extractQRDataFields * Feat/aadhar fixes (#1099) * Fix - android aadhar qr scanner * fixes * update text * yarn nice * run prettier * Add mock Aadhaar certificates for development - Introduced hardcoded Aadhaar test certificates for development purposes. - Moved Aadhaar mock private and public keys to a dedicated file for better organization. - Updated the mock ID document generation utility to utilize the new Aadhaar mock certificates. * prettier write * add 'add-aadhaar' button (#1100) * Update .gitleaks.toml to include path for mock certificates in the common/dist directory * yarn nice * Enhance Aadhaar error handling with specific error types - Updated the AadhaarUploadErrorScreen to display different messages based on the error type (general or expired). - Modified the AadhaarUploadScreen to pass the appropriate error type when navigating to the error screen. - Set initial parameters for the home screen to include a default error type. * Update passport handling in proving machine to support Aadhaar document category - Modified the handling of country code in the useProvingStore to return 'IND' for Aadhaar documents. - Ensured that the country code is only fetched from passport metadata for non-Aadhaar documents. * tweak layout, text, change email to support, hide help button * fix ci, remove aadhaar logging, add aadhaar events * remove unused aadhaar tracking events * update globs * fix gitguardian config * don't track id --------- Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz> Co-authored-by: Seshanth.S🐺 <35675963+seshanthS@users.noreply.github.com> Co-authored-by: vishal <vishalkoolkarni0045@gmail.com>
50 lines
1.6 KiB
Swift
50 lines
1.6 KiB
Swift
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
|
|
|
//
|
|
// QRScannerBridge.swift
|
|
// OpenPassport
|
|
//
|
|
// Created by Rémi Colin on 23/07/2024.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftQRScanner
|
|
import React
|
|
import UIKit
|
|
import CoreImage
|
|
|
|
@objc(QRScannerBridge)
|
|
class QRScannerBridge: NSObject {
|
|
@objc
|
|
static func requiresMainQueueSetup() -> Bool {
|
|
return false
|
|
}
|
|
|
|
@objc
|
|
func scanQRCode(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
DispatchQueue.main.async {
|
|
let rootViewController = UIApplication.shared.keyWindow?.rootViewController
|
|
let qrScannerViewController = QRScannerViewController()
|
|
qrScannerViewController.completionHandler = { result in
|
|
resolve(result)
|
|
}
|
|
rootViewController?.present(qrScannerViewController, animated: true, completion: nil)
|
|
}
|
|
}
|
|
|
|
@objc
|
|
func scanQRCodeFromPhotoLibrary(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
DispatchQueue.main.async {
|
|
let rootViewController = UIApplication.shared.keyWindow?.rootViewController
|
|
let photoLibraryQRScanner = PhotoLibraryQRScannerViewController()
|
|
photoLibraryQRScanner.completionHandler = { result in
|
|
resolve(result)
|
|
}
|
|
photoLibraryQRScanner.errorHandler = { error in
|
|
reject("QR_SCAN_ERROR", error.localizedDescription, error)
|
|
}
|
|
rootViewController?.present(photoLibraryQRScanner, animated: true, completion: nil)
|
|
}
|
|
}
|
|
}
|