From bcd03cf31dcea28f81384cacc2b6ae0033442d52 Mon Sep 17 00:00:00 2001 From: chetan Date: Sat, 24 Oct 2026 19:09:44 +0530 Subject: [PATCH] docs(sdk-less): add device_model to Android and iOS device data (LIN-3997) Co-Authored-By: Claude Opus 5.5 (1M context) --- sdk-less/android-device-data.mdx | 5 ++++- sdk-less/android-quickstart.mdx | 1 + sdk-less/ios-device-data.mdx | 2 ++ sdk-less/ios-quickstart.mdx | 13 +++++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sdk-less/android-device-data.mdx b/sdk-less/android-device-data.mdx index f2790ce9..478f73d9 100644 --- a/sdk-less/android-device-data.mdx +++ b/sdk-less/android-device-data.mdx @@ -51,6 +51,7 @@ dependencies { | `device_ip` | Network interfaces | Recommended. IP matching fallback. | | `user_agent` | `WebSettings.getDefaultUserAgent` | Recommended. Fingerprint matching. | | `app_version`, `build_number`, `bundle_id`, `application_name` | `PackageManager` | Recommended. | +| `device_model` | `Build.MODEL` | Recommended. Shown as Device Model on the dashboard. | | `manufacturer`, `brand`, `device_name`, `system_version` | `Build` | Recommended. | | `connectivity`, `carrier` | System services | Optional. | | `appsetid`, `appsetid_scope` | `AppSet` | Optional. | @@ -170,7 +171,9 @@ These are plain system lookups. The [full client](/sdk-less/android-quickstart) - `device_id`: `Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)` - `device_ip`: first non-loopback IPv4 from `NetworkInterface.getNetworkInterfaces()` - `user_agent`: `WebSettings.getDefaultUserAgent(context)` -- `manufacturer`, `brand`, `device_name`, `system_version`: `Build.MANUFACTURER`, `Build.BRAND`, `Build.MODEL`, `Build.VERSION.RELEASE` +- `device_model`: `Build.MODEL` (for example `SM-S936B`) +- `device_name`: `"${Build.MANUFACTURER} ${Build.MODEL}"` (for example `samsung SM-S936B`) +- `manufacturer`, `brand`, `system_version`: `Build.MANUFACTURER`, `Build.BRAND`, `Build.VERSION.RELEASE` - App info: `PackageManager.getPackageInfo` for `app_version` and `build_number`, `context.packageName` for `bundle_id` **Need help?** Contact [support@linkrunner.io](mailto:support@linkrunner.io) diff --git a/sdk-less/android-quickstart.mdx b/sdk-less/android-quickstart.mdx index 8fdfe27b..7b21ed1f 100644 --- a/sdk-less/android-quickstart.mdx +++ b/sdk-less/android-quickstart.mdx @@ -98,6 +98,7 @@ object LinkrunnerDeviceData { // Device info d.put("device_id", Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID) ?: "") d.put("device_name", "${Build.MANUFACTURER} ${Build.MODEL}") + d.put("device_model", Build.MODEL ?: "") d.put("manufacturer", Build.MANUFACTURER) d.put("brand", Build.BRAND) d.put("system_version", Build.VERSION.RELEASE ?: "") diff --git a/sdk-less/ios-device-data.mdx b/sdk-less/ios-device-data.mdx index 13092a89..49f231a2 100644 --- a/sdk-less/ios-device-data.mdx +++ b/sdk-less/ios-device-data.mdx @@ -24,6 +24,7 @@ To collect the IDFA, add a tracking usage description. Nothing else here needs a | `adservices_attribution_token` | `AAAttribution.attributionToken()` | **High**. Apple Search Ads attribution. | | `idfa` | `ASIdentifierManager`, after ATT consent | **High**, when the user allows tracking. | | `idfv` | `UIDevice.identifierForVendor` | Recommended. Matching fallback. | +| `device_model` | `uname()` hardware identifier | Recommended. Shown as Device Model on the dashboard. | | `device`, `device_name`, `system_version` | `UIDevice` | Recommended. | | `brand`, `manufacturer` | Always `"Apple"` | Recommended. | | `version`, `build_number`, `bundle_id` | `Bundle.main` | Recommended. | @@ -105,6 +106,7 @@ Apply it with `SKAdNetwork.updatePostbackConversionValue`. The [full client](/sd Plain framework lookups. The [full client](/sdk-less/ios-quickstart) includes them. +- `device_model`: the hardware identifier from `uname()` `machine` (for example `iPhone17,3`). On the simulator, read `SIMULATOR_MODEL_IDENTIFIER` from the environment. Linkrunner uses only this field for Device Model on iOS, because `device_name` can be the name the user gave the phone. - `device`, `device_name`, `system_version`: `UIDevice.current` - `device_display`: `UIScreen.main.bounds` and `scale` - `locale`, `language`, `country`: `Locale.current` diff --git a/sdk-less/ios-quickstart.mdx b/sdk-less/ios-quickstart.mdx index 81feebe4..aa964e65 100644 --- a/sdk-less/ios-quickstart.mdx +++ b/sdk-less/ios-quickstart.mdx @@ -273,9 +273,22 @@ final class LinkrunnerClient { ] ] if let idfv = device.identifierForVendor?.uuidString { d["idfv"] = idfv } + if let model = deviceModelIdentifier() { d["device_model"] = model } return d } + private func deviceModelIdentifier() -> String? { + if let sim = ProcessInfo.processInfo.environment["SIMULATOR_MODEL_IDENTIFIER"], !sim.isEmpty { + return sim + } + var systemInfo = utsname() + guard uname(&systemInfo) == 0 else { return nil } + let id = withUnsafeBytes(of: &systemInfo.machine) { raw in + String(bytes: raw.prefix { $0 != 0 }, encoding: .utf8) + } + return (id?.isEmpty ?? true) ? nil : id + } + private func idfa() -> String? { guard ATTrackingManager.trackingAuthorizationStatus == .authorized else { return nil } return ASIdentifierManager.shared().advertisingIdentifier.uuidString