Pre-Built UI
Leverage our Pre-Built UI for rapid integration and customization of authentication flows in your application. This setup allows you to adjust appearance and functionality through the OTPLESS dashboard with minimal coding.
Step 1: Add SDK Dependency
To get started, incorporate the OTPLESS SDK into your project. Update your app’s build.gradle
file by adding the following dependency:
Make sure to synchronize
your Gradle project to fetch the dependency.
Step 2: Configure AndroidManifest.xml
Modify your AndroidManifest.xml
to include an intent filter within the activity responsible for sign-up or sign-in. This setup is crucial for handling deep links.
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
Additionally, ensure your activity is set to singleTop
launch mode and exported
attribute is true:
Step 3: Configure Your Signup/Sign In Activity
First, import necessary classes from the OTPLESS SDK:
Declare an OtplessView
instance:
Within your onCreate()
method, initialize and set up the OTPLESS Sign in:
Configure Auth Method
Select from a wide array of auth methods, including SMS, WhatsApp, Email, Google, and many more
Configure UI
Customize logos, headings, color schemes, and more to match your brand identity and improve UX.
Step 4: Handle Callback
Implement a callback method to handle the response from the OTPLESS SDK:
Override onNewIntent()
Ensure you override the onNewIntent()
method to correctly handle intent verification:
Step 5: Handle Back Press
Override the onBackPressed()
method to manage back press actions properly:
🏁 Checkpoint
To ensure a smooth integration process:
- Deploy your app/website with the included OTPLESS SDK.
- Conduct tests to verify the sign-in flow functions correctly.
- Ensure that after a successful sign-in, the user is redirected back to your app/website and their information is correctly logged in the console.
User Information Response Structure
The structure of the user information returned upon successful sign-in is as follows:
You can check out a complete sample response here.
Next Steps
Was this page helpful?