Requirements
- The compileSdk version should be 35.
- The minimum SDK version supported by the SDK is 21.
- The kotlin version should be 1.9.0 and above.
- The gradle version should be 8.3.1 and above.
Step 1: Add SDK Dependency
First, let’s add the OTPLESS SDK to your project. Update your app’sbuild.gradle file by adding the following dependency:
Make sure to synchronize your Gradle project to fetch the dependency.
Step 2: Configure AndroidManifest.xml
Next, we’ll configure your AndroidManifest.xml to handle deep links. This setup is crucial for managing the authentication flow via Link. Add the following intent filter within the activity responsible for sign-up or sign-in:singleTop launch mode and that the exported attribute is true:
Step 3: Configure Your Signup/Sign In Activity
Great! Now let’s configure your activity for sign-up or sign-in. Below are the steps for both Java and Kotlin.- Java
- Kotlin
First, import the necessary classes from the OTPLESS SDK:Declare an Within your Override
OtplessView instance:onCreate() method, initialize and set up the OTPLESS sign-in:Step 4: Handle Callback
Now, let’s implement a callback method to handle the response from the OTPLESS SDK:Error Codes
Override
onNewIntent()Ensure you override the onNewIntent() method to correctly handle intent verification:onBackPressed()Override the onBackPressed() method to manage back press actions properly:Step 5: Initiate Authentication
Well done! You have completed the foundational setup of the SDK. Now, let’s move to the next step and understand how to initiate and verify different authentication modes. Choose the authentication mode you want to integrate from the options below:OTP
Send a One-Time Password (OTP) via SMS, WhatsApp, or Email for secure user verification.
Magic Link
Provide a seamless login experience by sending an authentication link through SMS, WhatsApp, or Email.
Social Auth
Authenticate users through popular social applications like WhatsApp, Google, Apple, and GitHub.