Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sdk-less/android-device-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions sdk-less/android-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?: "")
Expand Down
2 changes: 2 additions & 0 deletions sdk-less/ios-device-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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`
Expand Down
13 changes: 13 additions & 0 deletions sdk-less/ios-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading