The Fraud Prevention SDK for iOS enables real-time threat detection and risk assessment in your mobile application. Once integrated, the SDK automatically collects device and behavioral telemetry and submits it to Mosaic for analysis. When specific user actions occur (such as login or account registration), you can report those events to receive risk-based recommendations via the Recommendations backend API.
- Collects device and behavioral data automatically in the background
- Reports user action events (login, registration, transaction, etc.) for risk assessment
- Provides device session tokens for correlating client-side and backend events
- iOS 13+
- Xcode 11+
Add the package dependency to your Xcode project or Package.swift:
dependencies: [
.package(url: "https://github.com/TransmitSecurity/accountprotection-ios-sdk.git", .upToNextMajor(from: "3.0.0"))
]The SDK can be initialized using either a plist configuration file or SDK parameters.
Create a TransmitSecurity.plist file in your project:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>credentials</key>
<dict>
<key>baseUrl</key>
<string>https://api.transmitsecurity.io/</string>
<key>clientId</key>
<string>[CLIENT_ID]</string>
</dict>
</dict>
</plist>Initialize the SDK at app launch:
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
TSAccountProtection.initializeSDK()
return true
}
}Configure the base server URL based on your region:
| Region | Base URL |
|---|---|
| US | https://api.transmitsecurity.io/ |
| EU | https://api.eu.transmitsecurity.io/ |
| Canada | https://api.ca.transmitsecurity.io/ |
| Australia | https://api.au.transmitsecurity.io/ |
| Japan | https://api.gasne1-ts01.transmitsecurity.io/ |
| Sandbox | https://api.sbx.transmitsecurity.io/ |
| Custom domain | https://<your-domain>.com/ (see Custom domains) |