iOS
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:
1dependencies: [
2 // Check https://github.com/maxmind/device-ios/releases for the latest version.
3 .package(url: "https://github.com/maxmind/device-ios.git", from: "0.1.0")
4]
Check the device-ios releases for the latest version.
Initialization
Initialize the SDK with your
MaxMind account ID.
Replace MAXMIND_ACCOUNT_ID with your account ID.
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.
Explicit device linking examples
Capture the trackingToken from the collectAndSend() result and pass it to
your backend for inclusion in the minFraud API request.
On your backend, include the token in the minFraud API request:
1{
2 "device": {
3 "ip_address": "2001:db8::ff00:42:8329",
4 "tracking_token": "token-value-from-client"
5 }
6}
For full SDK documentation, see the device-ios README.