Prerequisites

Install the OTPLESS SDK dependency by running the following command in your terminal at the root of your React Native project before utilizing OtplessSecureService:

npm install otpless-ionic

Step 1: Add OtplessSecureService dependencies

To integrate OtplessSecureService into your project, include the following dependency in your app-level build.gradle file under the dependencies section:

implementation 'io.github.otpless-tech:otpless-secure-sdk:0.1.5'

In your project-level build.gradle, add the following:

allprojects {  
  repositories {  
        maven {  url 'https://maven.fpregistry.io/releases'  }  
        maven {  url 'https://jitpack.io'  }  
  }
 }

Make sure to sync your project with Gradle after adding this dependency.

Step 2: Instantiate the OtplessManager

Create an instance of OtplessManager in your javascript/typescript file.

let manager = new OtplessManager();

Step 3: Attach OtplessSecureService in your LoginScreen.

When your login screen launches, attach the OtplessSecureService using your APP_ID. This ensures the secure service is properly initialized on Android platforms and ready to use before authentication.

try {
    await manager.attachSecureSDK(APPID);
    alert('Secure SDK attached successfully.');
} catch (error) {
    alert('Failed to attach Secure SDK:' + error);
}