From b44f56df3ecab220b037b2ae0e65fd6fc3502d63 Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Wed, 6 May 2026 10:10:34 -0400 Subject: [PATCH 1/5] Mention Java as well for the Android SDK --- content/minfraud/track-devices/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/minfraud/track-devices/_index.md b/content/minfraud/track-devices/_index.md index de7c2ada8..724915050 100644 --- a/content/minfraud/track-devices/_index.md +++ b/content/minfraud/track-devices/_index.md @@ -23,7 +23,7 @@ Device ID. text: "Track devices on your website using JavaScript." - heading: "Android" url: "/minfraud/track-devices/android" - text: "Track devices in your Android app using Kotlin." + text: "Track devices in your Android app using Kotlin or Java." {{}} From da68f7264d7dbc05e6d7f58f763a380fc957642f Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Wed, 6 May 2026 09:50:47 -0400 Subject: [PATCH 2/5] Add iOS Device SDK page --- content/minfraud/track-devices/ios.md | 137 ++++++++++++++++++++++++++ stopwords.txt | 2 + 2 files changed, 139 insertions(+) create mode 100644 content/minfraud/track-devices/ios.md diff --git a/content/minfraud/track-devices/ios.md b/content/minfraud/track-devices/ios.md new file mode 100644 index 000000000..19266e9dd --- /dev/null +++ b/content/minfraud/track-devices/ios.md @@ -0,0 +1,137 @@ +--- +draft: false +title: iOS +--- + +{{< alert warning >}} The MaxMind Device SDK for iOS is currently in beta. +{{}} + +The MaxMind Device SDK for iOS collects device data and sends it to MaxMind so +that the minFraud service can assign a Device ID and use it to detect fraud +across sessions. The SDK exposes both a Swift API and an Objective-C API; +Objective-C classes use an `MM` prefix. + +## Requirements + +- iOS 15.0+ +- Swift 5.9+ +- Xcode 15.0+ + +## Installation + +Add the MaxMind Device SDK as a Swift Package dependency. In Xcode, choose +**File > Add Package Dependencies…** and enter the repository URL +`https://github.com/maxmind/device-ios.git`. + +Or add it to your `Package.swift`: + +```swift +dependencies: [ + .package(url: "https://github.com/maxmind/device-ios.git", from: "0.1.0") +] +``` + +Check the [device-ios releases](https://github.com/maxmind/device-ios/releases) +for the latest version. + +## Initialization + +Initialize the SDK with your +[MaxMind account ID](https://support.maxmind.com/knowledge-base/articles/find-your-maxmind-account-id). +Replace `MAXMIND_ACCOUNT_ID` with your account ID. + +{{< codeset >}} + +```swift +import MinFraudDevice + +let config = SDKConfig(accountID: MAXMIND_ACCOUNT_ID) +let tracker = DeviceTracker(config: config) +``` + +```objc +@import MinFraudDevice; + +MMSDKConfig *config = [[MMSDKConfig alloc] initWithAccountID:MAXMIND_ACCOUNT_ID]; +MMDeviceTracker *tracker = [[MMDeviceTracker alloc] initWithConfig:config]; +``` + +{{}} + +## Collect and send device data + +Call `collectAndSend()` to collect device data and send it to MaxMind. The Swift +API uses Swift concurrency (`async`/`await`); the Objective-C API uses a +completion handler. + +{{< codeset >}} + +```swift +import MinFraudDevice + +do { + let result = try await tracker.collectAndSend() + print("Device data sent successfully") +} catch { + print("Failed to send device data: \(error)") +} +``` + +```objc +[tracker collectAndSendWithCompletion:^(MMTrackingResult *result, NSError *error) { + if (error) { + NSLog(@"Failed to send device data: %@", error); + return; + } + NSLog(@"Device data sent successfully"); +}]; +``` + +{{}} + +## Explicit device linking examples + +Capture the `trackingToken` from the `collectAndSend()` result and pass it to +your backend for inclusion in the minFraud API request. + +{{< codeset >}} + +```swift +import MinFraudDevice + +do { + let result = try await tracker.collectAndSend() + let token = result.trackingToken + // Send the tracking token to your backend + sendTokenToBackend(token) +} catch { + print("Failed to send device data: \(error)") +} +``` + +```objc +[tracker collectAndSendWithCompletion:^(MMTrackingResult *result, NSError *error) { + if (error) { + NSLog(@"Failed to send device data: %@", error); + return; + } + // Send the tracking token to your backend + [self sendTokenToBackend:result.trackingToken]; +}]; +``` + +{{}} + +On your backend, include the token in the minFraud API request: + +```json +{ + "device": { + "ip_address": "2001:db8::ff00:42:8329", + "tracking_token": "token-value-from-client" + } +} +``` + +For full SDK documentation, see the +[device-ios README](https://github.com/maxmind/device-ios#readme). diff --git a/stopwords.txt b/stopwords.txt index 174891408..9ab803b4d 100644 --- a/stopwords.txt +++ b/stopwords.txt @@ -94,11 +94,13 @@ mmapiwsid mmdb mmdbinspect mmdblua +MMSDK Movistar Msxml Nord Norte Nubilum +objc Odido omni onFailure From 6e19540fefdae855ab81a206304ae66542a5ea3f Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Wed, 6 May 2026 09:52:00 -0400 Subject: [PATCH 3/5] Wire-up new page --- content/minfraud/track-devices/_index.md | 10 +++++++--- hugo.toml | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/content/minfraud/track-devices/_index.md b/content/minfraud/track-devices/_index.md index 724915050..c34dc82ee 100644 --- a/content/minfraud/track-devices/_index.md +++ b/content/minfraud/track-devices/_index.md @@ -24,6 +24,9 @@ Device ID. - heading: "Android" url: "/minfraud/track-devices/android" text: "Track devices in your Android app using Kotlin or Java." +- heading: "iOS" + url: "/minfraud/track-devices/ios" + text: "Track devices in your iOS app using Swift or Objective-C." {{}} @@ -61,9 +64,10 @@ changes. 3. Include the token in your minFraud API request's `device` object as `tracking_token`. -See the [Web](/minfraud/track-devices/web#explicit-device-linking-examples) and -[Android](/minfraud/track-devices/android#explicit-device-linking-examples) -guides for platform-specific examples. +See the [Web](/minfraud/track-devices/web#explicit-device-linking-examples), +[Android](/minfraud/track-devices/android#explicit-device-linking-examples), and +[iOS](/minfraud/track-devices/ios#explicit-device-linking-examples) guides for +platform-specific examples. ### Token handling diff --git a/hugo.toml b/hugo.toml index f6e8e122f..84270b6e7 100644 --- a/hugo.toml +++ b/hugo.toml @@ -55,6 +55,11 @@ title = 'MaxMind' pageRef = '/minfraud/track-devices/android' parent = 'Track Devices' weight = 20 + [[menus.minfraud]] + name = 'iOS' + pageRef = '/minfraud/track-devices/ios' + parent = 'Track Devices' + weight = 30 [[menus.minfraud]] name = 'minFraud Alerts' pageRef = '/minfraud/alerts' From 460d0c0e809536e4df2e86e77d283188d85f3aca Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Wed, 6 May 2026 09:57:29 -0400 Subject: [PATCH 4/5] Readme fragment was not found in document, but does work --- lychee.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/lychee.toml b/lychee.toml index a5d141dc3..e3d3857f5 100644 --- a/lychee.toml +++ b/lychee.toml @@ -40,6 +40,7 @@ exclude = [ '^https://www\.maxmind\.com/en/accounts/', # MaxMind account pages (require login) '^https://search\.maven\.org/#', # Hash-based JS routing, not HTML fragments '^https://github\.com/maxmind/device-android', # README fragment not parseable + '^https://github\.com/maxmind/device-ios', # README fragment not parseable '^https://github\.com/maxmind/device-tracking', # README fragment not parseable 'maxmind-ip-network-data#anycast', # Fragment not parseable on support site 'fraud-prevention/overview#buy-now', # Fragment not parseable on maxmind.com From 92bf5f39aae15f35449480ab4d26c5274ca83b4d Mon Sep 17 00:00:00 2001 From: Patrick Cronin Date: Wed, 6 May 2026 14:54:15 -0400 Subject: [PATCH 5/5] Add notes to check for the latest version --- content/minfraud/track-devices/android.md | 2 ++ content/minfraud/track-devices/ios.md | 1 + 2 files changed, 3 insertions(+) diff --git a/content/minfraud/track-devices/android.md b/content/minfraud/track-devices/android.md index 927db54a8..3adbd183d 100644 --- a/content/minfraud/track-devices/android.md +++ b/content/minfraud/track-devices/android.md @@ -19,6 +19,7 @@ Add the MaxMind Device SDK dependency to your app-level `build.gradle` file. ```kotlin // build.gradle.kts (Kotlin DSL) dependencies { + // Check https://search.maven.org/artifact/com.maxmind.device/device-sdk for the latest version. implementation("com.maxmind.device:device-sdk:0.2.0") } ``` @@ -26,6 +27,7 @@ dependencies { ```groovy // build.gradle (Groovy DSL) dependencies { + // Check https://search.maven.org/artifact/com.maxmind.device/device-sdk for the latest version. implementation 'com.maxmind.device:device-sdk:0.2.0' } ``` diff --git a/content/minfraud/track-devices/ios.md b/content/minfraud/track-devices/ios.md index 19266e9dd..55e61af3c 100644 --- a/content/minfraud/track-devices/ios.md +++ b/content/minfraud/track-devices/ios.md @@ -27,6 +27,7 @@ Or add it to your `Package.swift`: ```swift dependencies: [ + // Check https://github.com/maxmind/device-ios/releases for the latest version. .package(url: "https://github.com/maxmind/device-ios.git", from: "0.1.0") ] ```