Mobile SDKs
Native iOS and Android libraries for device identification without a WebView. Both SDKs are in active development — APIs and signal coverage may change before general availability.
Back to main docsBeta software
The iOS and Android SDKs are released as Beta. Signal schemas, packaging coordinates, and response fields may evolve. Test thoroughly in staging before production rollout and monitor the main documentation for updates.
Swift · iOS 13+
iOS SDK
Swift Package Manager library that collects native hardware, GPU, sensor, and integrity signals, then identifies the device via POST /api/device-id.
Installation
Add the package from sdks/ios/ in this monorepo, or reference the published Swift package when available.
# Package.swift — add the LRDefender package dependency
dependencies: [
.package(path: "../sdks/ios"), // monorepo path
// or remote:
// .package(url: "https://github.com/lightningresearch/ios-sdk", from: "2.0.0"),
],
targets: [
.target(
name: "YourApp",
dependencies: ["LRDefender"]
),
]Basic usage
Call configure() once at launch, then getFingerprint() to collect signals and identify the device.
import LRDefender
// Configure once at app launch
LRDefender.shared.configure(LRDefenderConfig(
apiKey: "lr_live_xxxxxxxx",
endpoint: "https://api.lrdefender.lightningresearch.ai",
region: "us",
enableSealedResults: false,
timeout: 30
))
// Identify the device (collects signals + POSTs to /api/device-id)
Task {
do {
let result = try await LRDefender.shared.getFingerprint()
print(result.deviceId) // "fp_9k2x..."
print(result.confidence) // 0.97
print(result.matchType) // "exact"
} catch {
print("Fingerprint error:", error.localizedDescription)
}
}Signal collection
- Hardware: processor count, physical memory, machine model
- GPU: Metal device name and capabilities
- Display: screen dimensions, scale, brightness
- Secure Enclave: availability and biometric type
- Network: connection type and interface hints
- Sensors: accelerometer, gyroscope samples
- Integrity: jailbreak and simulator detection
- Locale: timezone, language, region
Kotlin · API 21+
Android SDK
Gradle library that gathers OpenGL ES, hardware, sensor, and integrity signals, then identifies the device via POST /api/device-id.
Installation
Include the module from sdks/android/ in this monorepo, or add the published Maven coordinate when available.
// settings.gradle.kts — include the SDK module (monorepo)
include(":lrdefender-sdk")
project(":lrdefender-sdk").projectDir = file("../sdks/android")
// app/build.gradle.kts
dependencies {
implementation(project(":lrdefender-sdk"))
// or published artifact:
// implementation("ai.lightningresearch:android-sdk:2.0.0")
}Basic usage
Call configure(context, config) once, then getFingerprint() from a coroutine to collect signals and identify the device.
import com.lrdefender.sdk.LRDefender
import com.lrdefender.sdk.LRDefenderConfig
// Configure once (requires Application context)
LRDefender.configure(
context = applicationContext,
config = LRDefenderConfig(
apiKey = "lr_live_xxxxxxxx",
endpoint = "https://api.lrdefender.lightningresearch.ai",
region = "us",
enableSealedResults = false,
timeoutSeconds = 30
)
)
// Identify the device (collects signals + POSTs to /api/device-id)
lifecycleScope.launch {
try {
val result = LRDefender.getFingerprint()
Log.d("LRDefender", result.deviceId) // "fp_9k2x..."
Log.d("LRDefender", result.confidence) // 0.97
Log.d("LRDefender", result.matchType) // "exact"
} catch (e: Exception) {
Log.e("LRDefender", "Fingerprint error", e)
}
}Signal collection
- Hardware: manufacturer, model, chipset, ABI list
- GPU: OpenGL ES vendor, renderer, version
- Display: resolution, density, refresh rate
- System: OS version, security patch, kernel
- Network: connection type and carrier info
- Sensors: accelerometer, gyroscope, magnetometer
- Integrity: root detection, emulator checks
- Storage: available space and battery state
For browser integration, collector sessions, and the full API reference, see the main documentation. Mobile SDKs use your long-lived API key directly — keep keys in secure storage (Keychain / EncryptedSharedPreferences).
View main docs