Including identity transfer links

The SDK will append a tid URL query parameter to all links opened from a mobile app. To limit this behavior, and only append a tid to a specific set of links to which the SDK should append a tid, call the mxoIdentityTransferConfiguration Kotlin top-level property or MedalliaMXO.setIdentityTransferConfiguration Java method, as shown below:

import com.medallia.mxo.identitytransfer.MXOIdentityTransferUriMatcher
import com.medallia.mxo.identitytransfer.mxoIdentityTransferConfiguration
import com.medallia.mxo.mxoIdentityTransferConfiguration
import java.net.URI

// This example shows how to include identity transfer links. 
// Example with ExactMatch(URI)
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration {
	includeList = setOf(
   	MXOIdentityTransferUriMatcher.ExactMatch(URI("http://www.google.com")),
)}

// Example with RegexMatch()
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration{
	includeList = setOf(
    	MXOIdentityTransferUriMatcher.RegexMatch("https://(simple|en)\\.wikipedia\\.org".toRegex())
)}

// This example shows how to edit the identity transfer configuration.
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration.copy {
	includeList = setOf(
		MXOIdentityTransferUriMatcher.ExactMatch(URI("http://www.newLink.com")),
        )
}
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration.copy {
	includeList = includeList.orEmpty().plus(
		MXOIdentityTransferUriMatcher.ExactMatch(URI("http://www.newLink.com")),
	)
}
import com.medallia.mxo.MedalliaMXO;
import com.medallia.mxo.identitytransfer.MXOIdentityTransferConfiguration;
import com.medallia.mxo.identitytransfer.MXOIdentityTransferUriMatcher;
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
import kotlin.text.Regex;

// This example shows how to include identity transfer links. 
// Example with ExactMatch(URI)
Set<MXOIdentityTransferUriMatcher> exactMatchIncludeList = new HashSet<>();
        try {
		exactMatchIncludeList.add(new MXOIdentityTransferUriMatcher.ExactMatch(URI.create("http://www.google.com")));
        } catch (Exception e) {
            	e.printStackTrace();
        }
        MXOIdentityTransferConfiguration currentConfiguration = MedalliaMXO.getIdentityTransferConfiguration();
        MXOIdentityTransferConfiguration.Builder builder = currentConfiguration != null ? currentConfiguration.builder() : new MXOIdentityTransferConfiguration.Builder();
        MXOIdentityTransferConfiguration updatedConfiguration = builder
                .includeList(exactMatchIncludeList)
                .build();
        MedalliaMXO.setIdentityTransferConfiguration(updatedConfiguration);

// Example with RegexMatch()
Set<MXOIdentityTransferUriMatcher> regexMatchIncludeList = new HashSet<>();
try {
	final Regex wikipediaSubDomains = new Regex("https://(simple|en)\\.wikipedia\\.org");
	regexMatchIncludeList.add(new MXOIdentityTransferUriMatcher.RegexMatch(wikipediaSubDomains));
	} catch (Exception e) {
            	e.printStackTrace();
        }
        currentConfiguration = MedalliaMXO.getIdentityTransferConfiguration();
        builder = currentConfiguration != null ? currentConfiguration.builder() : new MXOIdentityTransferConfiguration.Builder();
        updatedConfiguration = builder.includeList(regexMatchIncludeList).build();
        MedalliaMXO.setIdentityTransferConfiguration(updatedConfiguration);


// Adding a new link to the list.
currentConfiguration = MedalliaMXO.getIdentityTransferConfiguration();
builder = currentConfiguration != null ? currentConfiguration.builder() : new MXOIdentityTransferConfiguration.Builder();
final Set<MXOIdentityTransferUriMatcher> currentIncludes = currentConfiguration != null ? new HashSet<>(currentConfiguration.getExcludeList()) : null;
final Set<MXOIdentityTransferUriMatcher> includeList = currentIncludes != null ? currentIncludes : Set.of();
        includeList.add(
                new MXOIdentityTransferUriMatcher.ExactMatch(
                        URI.create("http://newlink.com")
                ));
updatedConfiguration = builder
	.includeList(includeList)
	.build();
MedalliaMXO.setIdentityTransferConfiguration(updatedConfiguration);

When a link is included, a tid URL query parameter will be appended to the included link only, superseding any excluded identity transfer links

Note: Setting the included links list to an empty list or null clears the existing list.