This guide helps you migrate your Android 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().claimUserIdinActionEventOptionsis deprecated. UseclaimedUserIdinstead.
New features:
claimedUserIdandclaimedUserIdTypeparameters inActionEventOptionsfor typed user identification.TSClaimedUserIdTypeenum for specifying the type of claimed user ID.
Update your app/build.gradle dependency:
Before:
dependencies {
implementation("com.ts.sdk:accountprotection:2.1.+")
}After:
dependencies {
implementation("com.ts.sdk:accountprotection:3.+")
}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.
If you initialize using strings.xml, make sure it includes transmit_security_base_url:
<resources>
<string name="transmit_security_client_id">"CLIENT_ID"</string>
<string name="transmit_security_base_url">https://api.transmitsecurity.io/risk-collect/</string>
</resources>The setUserID() method has been renamed to setAuthenticatedUser(). Update all occurrences in your code.
Before:
TSAccountProtection.setUserID(userId)After:
TSAccountProtection.setAuthenticatedUser(userId)The claimUserId property in ActionEventOptions is deprecated. Use claimedUserId and claimedUserIdType instead.
Before:
object : ActionEventOptions {
override val correlationId: String?
get() = correlationIdStr
override val claimUserId: String?
get() = claimUserIdStr
override val referenceUserId: String?
get() = referenceUserIdStr
}After:
object : ActionEventOptions {
override val correlationId: String?
get() = correlationIdStr
override val claimedUserId: String?
get() = "91e25bea0c..." // hashed identifier
override val claimedUserIdType: TSClaimedUserIdType?
get() = TSClaimedUserIdType.EMAIL
override val referenceUserId: String?
get() = referenceUserIdStr
}- 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.