Skip to content

This guide helps you migrate your Android Fraud Prevention integration to version 3.x.

Important

Version 3.x includes breaking changes that will cause runtime errors if not addressed. Review all changes before upgrading.

What's new

Breaking changes:

  • setUserID() is renamed to setAuthenticatedUser().
  • baseUrl is now a mandatory parameter in initialize().
  • claimUserId in ActionEventOptions is deprecated. Use claimedUserId instead.

New features:

  • claimedUserId and claimedUserIdType parameters in ActionEventOptions for typed user identification.
  • TSClaimedUserIdType enum for specifying the type of claimed user ID.

Migrate your integration to v3.x

Step 1: Update SDK dependency

Update your app/build.gradle dependency:

Before:

dependencies {
    implementation("com.ts.sdk:accountprotection:2.1.+")
}

After:

dependencies {
    implementation("com.ts.sdk:accountprotection:3.+")
}

Step 2: Add baseUrl to initialization

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>

Step 3: Rename setUserID to setAuthenticatedUser

The setUserID() method has been renamed to setAuthenticatedUser(). Update all occurrences in your code.

Before:

TSAccountProtection.setUserID(userId)

After:

TSAccountProtection.setAuthenticatedUser(userId)

Step 4: Update triggerAction options

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
}

Step 5: Test your integration

  • 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.