Excluding identity transfer links

The SDK will append a tid URL query parameter to all links opened from a mobile app. To limit this behavior to a specific set of links, exclude the links to which the SDK should not append a tid, call the method identityTransferConfiguration and passing your links as shown below:

// This example shows how to exclude identity transfer links. 
var excludeList = [MXOIdentityTransferUriMatcher]()

// Example with MXOIdentityTransferUriMatcher(withUrl:)
if let google = URL(string: "www.google.com"), let excludeGoogle = try? MXOIdentityTransferUriMatcher(withUrl: google) {
	excludeList.append(excludeGoogle)
}

// Example with MXOIdentityTransferUriMatcher(withRegex:)
if let wiki = try? NSRegularExpression(pattern: ".*\\.wikipedia\\.com"), let excludeWiki = try? MXOIdentityTransferUriMatcher(withRegex: wiki) {
	excludeList.append(excludeWiki)
}

MedalliaMXO.identityTransferConfiguration = MXOIdentityTransferConfiguration { builder in
	builder.excludeList = excludeList
}

// This example shows how to edit the identity transfer configuration.
if let configBuilder = MedalliaMXO.identityTransferConfiguration?.builder(),
	var excludeList = configBuilder.excludeList,
	let url = URL(string: "https://www.newlink.com"),
	let excludeNewLink = try? MXOIdentityTransferUriMatcher.init(withUrl: url) {
		excludeList.append(excludeNewLink)
            	configBuilder.excludeList = excludeList
            	MedalliaMXO.identityTransferConfiguration = configBuilder.build()
}
// This example shows how to exclude identity transfer links. 
NSError *error;
NSMutableArray<MXOIdentityTransferUriMatcher *> *excludeList = [@[] mutableCopy];

// Example with MXOIdentityTransferUriMatcher(withUrl:)
MXOIdentityTransferUriMatcher *google = [MXOIdentityTransferUriMatcher initWithUrl:[NSURL URLWithString:@"www.google.com"] error:&error];
[excludeList addObject:google];

// Example with MXOIdentityTransferUriMatcher(withRegex:)
MXOIdentityTransferUriMatcher *wiki = [MXOIdentityTransferUriMatcher initWithRegex:[NSRegularExpression regularExpressionWithPattern:@".*\\.wikipedia\\.com" options:0 error:nil] error:&error];
[excludeList addObject:wiki];
MedalliaMXO.identityTransferConfiguration = [MXOIdentityTransferConfiguration initWithBuilder:^(MXOIdentityTransferConfigurationBuilder * _Nonnull builder) {
        builder.excludeList = [excludeList copy];
}];

// This example shows how to edit the identity transfer configuration.
NSError *error;
NSURL *newlink = [NSURL URLWithString:@"www.newlink.com"];
MXOIdentityTransferUriMatcher *excludeNewlink = [MXOIdentityTransferUriMatcher initWithUrl:newlink error:&error];
MXOIdentityTransferConfigurationBuilder *builder = MedalliaMXO.identityTransferConfiguration.builder ? MedalliaMXO.identityTransferConfiguration.builder : [MXOIdentityTransferConfigurationBuilder new];
NSMutableArray<MXOIdentityTransferUriMatcher *> *excludeList = builder.excludeList ? [builder.excludeList mutableCopy] : [@[] mutableCopy];
[excludeList addObject:excludeNewlink];
builder.excludeList = [excludeList mutableCopy];
MedalliaMXO.identityTransferConfiguration = [builder build];

If a link is excluded, a tid URL query parameter will be appended to all other links but the excluded link, but is superseded by any included identity transfer links.