This guide helps you migrate your iOS Fraud Prevention integration to version 3.x.
Version 3.x includes breaking changes that will cause runtime errors if not addressed. Review all changes before upgrading.
Breaking changes:
setUserId()is renamed tosetAuthenticatedUser().baseUrlis now a mandatory parameter ininitialize().claimUserIdinTSActionEventOptionsis deprecated. UseclaimedUserIdinstead.
New features:
claimedUserIdandclaimedUserIdTypeparameters inTSActionEventOptionsfor typed user identification.
Update your Swift Package Manager dependency to the latest major version:
Before:
dependencies: [
.package(url: "https://github.com/TransmitSecurity/accountprotection-ios-sdk.git", .upToNextMajor(from: "2.0.0"))
]After:
dependencies: [
.package(url: "https://github.com/TransmitSecurity/accountprotection-ios-sdk.git", .upToNextMajor(from: "3.0.0"))
]If you initialize the SDK with explicit parameters using initialize(), baseUrl is now a required parameter. The baseUrl value must include the /risk-collect/ path.
Before:
TSAccountProtection.initialize(clientId: "[CLIENT_ID]")After:
TSAccountProtection.initialize(baseUrl: "https://api.transmitsecurity.io/risk-collect/", clientId: "[CLIENT_ID]")If you initialize using initializeSDK() with a TransmitSecurity.plist file, make sure the plist includes a baseUrl key.
The setUserId() method has been renamed to setAuthenticatedUser(). Update all occurrences in your code.
Before:
TSAccountProtection.setUserId("[USER_ID]")After:
TSAccountProtection.setAuthenticatedUser("[USER_ID]")The claimUserId parameter in TSActionEventOptions is deprecated. Use claimedUserId and claimedUserIdType instead.
Before:
let options = TSActionEventOptions(correlationId: "CORRELATION_ID",
claimUserId: "CLAIM_USER_ID",
referenceUserId: "REFERENCE_USER_ID",
transactionData: nil)After:
let options = TSActionEventOptions(correlationId: "CORRELATION_ID",
claimedUserId: "91e25bea0c...", // hashed identifier
claimedUserIdType: .email,
referenceUserId: "REFERENCE_USER_ID",
transactionData: nil)- Verify all SDK functionality works as expected.
- Check for any runtime errors related to renamed methods.
- Confirm that
triggerAction()returns action tokens as expected with the new parameter structure.