Skip to content

QR Code Reader Screen

Introduction

This screen allows a user to scan a QR code either from a picture on the device or with the camera. In the onboarding process, this is used to scan the QR code to get the application information and then use a different authentication method to authenticate the user.

QR Code Reader Screen

Examples

val screen = QRCodeReaderScreen(getTargetContext())
val css = QRCodeReaderSettings.Builder()
    .setAutoFocus(false)
    .setBarcodeFormat(233)
    .setInvalidQROk("invalid")
    .setInvalidQRMessage("invalid qr")
    .setSkipConfirmScreen(true)
    .setWaitForBarcodeDetectorInSec(10)
    .setInvalidQRTitle("Error")
    .setCameraNoticeTitle("cameraTitle")
    .setCameraNoticeMessage("test msg for camera")
    .setCameraNoticePositiveBtn("yes")
    .setCameraNoticeNegativeBtn("no")
    .setStorageNoticeTitle("storageTitle")
    .setStorageNoticeMessage("test msg for storage")
    .setStorageNoticePositiveBtn("Yes")
    .setStorageNoticeNegativeBtn("No")
    .build()
screen.initialize(css)
screen.setPhotoLibraryButtonOnClickListener {
    ...
}
screen.setCloseReaderButtonOnClickListener {
    ...
}
QRCodeReaderScreen screen = new QRCodeReaderScreen(getTargetContext());
QRCodeReaderSettings css = new QRCodeReaderSettings.Builder()
    .setAutoFocus(false)
    .setBarcodeFormat(233)
    .setInvalidQROk("invalid")
    .setInvalidQRMessage("invalid qr")
    .setSkipConfirmScreen(true)
    .setWaitForBarcodeDetectorInSec(10)
    .setInvalidQRTitle("Error")
    .setCameraNoticeTitle("cameraTitle")
    .setCameraNoticeMessage("test msg for camera")
    .setCameraNoticePositiveBtn("yes")
    .setCameraNoticeNegativeBtn("no")
    .setStorageNoticeTitle("storageTitle")
    .setStorageNoticeMessage("test msg for storage")
    .setStorageNoticePositiveBtn("Yes")
    .setStorageNoticeNegativeBtn("No")
    .build();
screen.initialize(css);
screen.setPhotoLibraryButtonOnClickListener( v -> {
    ...
});
screen.setCloseReaderButtonOnClickListener( v -> {
    ...
});

Last update: November 15, 2021