Overview

Hawcx SDK provides next-generation passwordless authentication for your iOS applications. With Hawcx, you can implement secure, frictionless authentication that works seamlessly across all user devices.

Passwordless Authentication

Eliminate password vulnerabilities and user friction

Multi-Device Support

Enable users to securely access their accounts across all their devices

Enterprise-Grade Security

Protect user accounts with advanced security protocols

Web Login Approval

Allow users to approve web logins from their mobile device

Biometric Integration

Leverage Face ID and Touch ID for additional security

Architecture

Quick Start

1

Installation

dependencies: [
    .package(url: "https://github.com/hawcx/hawcx_ios_sdk", .upToNextMajor(from: "3.7.0"))
]

Or add it directly in Xcode:

  1. Select File > Add Packages…
  2. Enter the package URL: https://github.com/hawcx/hawcx_ios_sdk
  3. Select “Up to Next Major Version” with version “3.7.0”
  4. Click “Add Package”
2

Initialize SDK

import HawcxSDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Initialize Hawcx SDK with your API key
        HawcxInitializer.shared.initialize(apiKey: "YOUR_API_KEY")
        return true
    }
}
3

Implement authentication using methods below:

Core Features

class SessionManager: DevSessionCallback {
    private let deviceSession = DevSession(apiKey: "YOUR_API_KEY")
    
    func fetchDeviceDetails() {
        deviceSession.GetDeviceDetails(callback: self)
    }
    
    // MARK: - DevSessionCallback Methods
    
    func onSuccess() {
        // Device details successfully retrieved
        // Access device data from UserDefaults
        if let data = UserDefaults.standard.data(forKey: "devDetails") {
            do {
                let devices = try JSONDecoder().decode([DeviceSessionInfo].self, from: data)
                // Process device information
                print("Retrieved \(devices.count) devices")
            } catch {
                print("Error decoding device details: \(error)")
            }
        }
    }
    
    func showError() {
        // Error fetching device details
        print("Error fetching device details")
    }
}

Troubleshooting

Error Codes

Error CodeDescription
userAlreadyExistsUser is already registered in the system
verifyOtpFailedInvalid or expired OTP
generateOtpFailedFailed to generate or send OTP
networkErrorConnection or server error
unknownErrorUnspecified error

Try it out!

Support