Migration Guide
Guide to migrate from Legacy Headless SDK to New Headless SDK
Overview
This guide will help you migrate from the legacy OTPLESS Headless SDK to the new version. The new SDK offers improved performance, reliability, and security features.
Key Changes
-
Package Name Change
- Legacy:
OtplessSDK/Core
- New:
OtplessBM/Core
- Legacy:
-
Minimum Requirements
- iOS 13.0+
- Xcode 12.0+
- Swift 5.5+
Migration Steps
1. Update Dependencies
Please find the latest version of the SDK here.
For Cocoapods:
For Swift Package Manager:
2. Update Import Statement
3. Update Initialization
4. Update URL Handling
In AppDelegate:
In SceneDelegate:
5. Update Request Objects
6. Update Authentication Calls
7. Update Response Handling
The callback handling has been significantly improved in the new SDK. Here’s how to migrate your callback implementation (For more information find new sdk documentation):
Key Differences in Response Handling:
-
Error Handling
- Legacy SDK: Basic error message extraction
- New SDK: Comprehensive error handling with specific error codes and messages
-
Silent Authentication The new SDK adds support for Silent Authentication (SNA) with proper fallback handling:
-
Delivery Status The new SDK provides detailed delivery status information:
8. Task Management
Add a task property to manage ongoing authentication requests:
Cancel ongoing tasks before starting new ones:
Note: Only cancel in the case of phone number request only, not for verify otp request
in Case verify otp request
Key Benefits of Migration
- Improved Performance: The new SDK is significantly faster and more efficient.
- Better Error Handling: More detailed error responses and improved error handling.
- Modern Swift Features: Utilizes modern Swift features like async/await for better concurrency.
- Improved Type Safety: Better type safety with enhanced Swift type system usage.
Need Help?
If you encounter any issues during migration, please reach out to our support team or refer to our documentation.
Was this page helpful?