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: Install OTPLESS SDK Dependency
Install the OTPLESS SDK dependency by running the following command in your terminal at the root of your React Native project:
Step 2: Platform-specific Integrations
- Add intent filter inside your
android/app/src/main/AndroidManifest.xml
file into your Main activity code block:
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add Network Security Config inside your
android/app/src/main/AndroidManifest.xml
file into your<application>
code block (Only required if you are using the SNA feature):
- Change your activity launchMode to singleTop and exported true for your Main Activity:
- Add intent filter inside your
android/app/src/main/AndroidManifest.xml
file into your Main activity code block:
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add Network Security Config inside your
android/app/src/main/AndroidManifest.xml
file into your<application>
code block (Only required if you are using the SNA feature):
- Change your activity launchMode to singleTop and exported true for your Main Activity:
- Add the following block to your
ios/info.plist
file:
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add the following block to your
ios/info.plist
file (Only required if you are using the SNA feature):
-
Go to build settings. Search for defines module, this option will appear in packaging change it to yes.
-
Create connector.swift file and it will ask to create bridging header, Click yes. Copy-paste the following code into your connector.swift file.
- Import the OTPLESS SDK in your respective
ios/AppDelegate.mm
file to handle redirection.
Step 3: Configure Sign up/Sign in
- Import the OTPLESS
package
on your login page.
- Add OTPLESS instance and initialize the SDK:
- Add the following code to Initiate OTPLESS Login Page
- Add the following code to handle response callback:
- When user successfully logs in, stop Otpless: