Disabling automatic identity transfer

Disabling identity transfer

By default, the SDK adds a tid URL query parameter to outgoing network requests. To disable it, call the method disableIdentityTransfer by passing true as shown below:

// Disabling the identity transfer.
MedalliaMXO.identityTransferConfiguration = MXOIdentityTransferConfiguration { builder in
	builder.disableIdentityTransfer = true
}

// Updating the identity transfer configuration.
let builder = MedalliaMXO.identityTransferConfiguration?.builder() ?? MXOIdentityTransferConfigurationBuilder()
builder.disableIdentityTransfer = false
MedalliaMXO.identityTransferConfiguration = builder.build()
// Disabling the identity transfer.
MedalliaMXO.identityTransferConfiguration = [MXOIdentityTransferConfiguration initWithBuilder:^(MXOIdentityTransferConfigurationBuilder * _Nonnull builder) {
	builder.disableIdentityTransfer = YES;
}];

// Updating the identity transfer configuration.
MXOIdentityTransferConfigurationBuilder *builder = MedalliaMXO.identityTransferConfiguration.builder ? MedalliaMXO.identityTransferConfiguration.builder : [MXOIdentityTransferConfigurationBuilder new];
builder.disableIdentityTransfer = NO;
MedalliaMXO.identityTransferConfiguration = [builder build];

This also disables the ability to automatically pick up parameters from deep links that open an app, while also preventing the SDK from adding a tid as a URL query parameter to web links opened from the app, resulting in the customer's identity not being transferred as they move across channels.

If you have disabled automatic identity transfer you can still send all URL parameters received as part of a URL scheme, which opens your app, by calling:

if let deepLink = URL(string: "yourUrl") {
	try? MedalliaMXO.process(deepLink: deepLink)
}
[MedalliaMXO processDeepLink:[NSURL URLWithString:@"yourUrl"] error:nil];

Pass the URL as a parameter into the processDeepLink SDK public method, as shown below:

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        try? MedalliaMXO.process(deepLink: url)
        return true
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    [MedalliaMXO processDeepLink:url error:nil];
    return YES;
}

This will send a PUT request to Medallia Experience Orchestration.

Appending a tid parameter to a NSURL to facilitate identity transfer

If you have disabled automatic identity transfer, you can still add a tid parameter to a link opened from the app programmatically, by calling generateIdentityTransfer as shown below:

if let url = URL(string: "yourUrl") {
	let identityUrl = try? MedalliaMXO.generateIdentityTransferUrl(url)
}
[MedalliaMXO generateIdentityTransferUrl:[NSURL URLWithString:@"yourUrl"] error:nil];

Pass the URL as a parameter, which will return back the same URL containing a tid parameter.

if let url = URL(string: "yourUrl") {
	let urlWithMxoTid = try? MedalliaMXO.generateIdentityTransferUrl(url)
}
NSURL *urlWithMxoTid = [MedalliaMXO generateIdentityTransferUrl:[NSURL URLWithString:@"yourUrl"] error:nil];