OtplessSwiftConnect SDK Integration
Welcome to the OTPLESS Connect SDK documentation. This sdk enables native and SFSafariViewController connectivity for your application.
Integration Steps
Step 1: Add SDK Dependency
SDK can be installed via both Cocoapods and Swift Package Manager.
Cocoapods
- Open your app’s project file
.xcodeproj
. - Add the following line into the dependencies section of your project’s
Podfile
:
Make sure to run the following commands in your root folder to fetch the dependency.
Swift Package Manager
- In Xcode, click File > Swift Packages > Add Package Dependency.
- In the dialog that appears, enter the repository URL: https://github.com/otpless-tech/iOS-Connect.git.
- Select the dependency rule as
exact version
and use the version1.0.1
.
Step 2: Initialize the SDK
In your app code, initialize the SDK before opening SafariViewController:
Step 3: Open SafariViewController with Parameters
After initialization, get the required query parameters from the SDK and append them to the login URL that loads in SafariViewController:
Step 4: Closing Otpless
Once the user has completed the login process, you can close your SFSafariViewController and stop Otpless: