Edit in GitHubLog an issue

Java

To append visitor information to the URL that is being used to open the web view, call appendVisitorInfoForUrl:

Copied to your clipboard
Identity.appendVisitorInfoForURL("https://example.com", new AdobeCallback<String>() {
@Override
public void call(String urlWithAdobeVisitorInfo) {
//handle the new URL here
//For example, open the URL on the device browser
//
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(urlWithAdobeVisitorInfo));
startActivity(i);
}
});

Alternately, starting in SDK version 1.4.0 (Identity version 1.1.0), you can call getUrlVariables and build your own URL:

Copied to your clipboard
Identity.getUrlVariables(new AdobeCallback<String>() {
@Override
public void call(String stringWithAdobeVisitorInfo) {
//handle the URL query parameter string here
//For example, open the URL on the device browser
//
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("https://example.com?" + urlWithAdobeVisitorInfo));
startActivity(i);
}
});

To append visitor information to the URL that is being used to open the web view, call appendToUrl:

Swift

Copied to your clipboard
let url = URL(string: "https://example.com")
Identity.appendTo(url: url) { appendedUrl, error in
if error != nil {
// handle error here
} else {
// handle appended url here
}
}

Objective-C

Copied to your clipboard
NSURL *sampleUrl = [NSURL URLWithString:@"https://example.com"];
[AEPMobileIdentity appendToUrl:sampleUrl completion:^(NSURL * _Nullable appendedUrl, NSError *error) {
if (error != nil) {
// Handle error here
} else {
// Handle appended url here
}
}];

Alternately, you can call getUrlVariables and build your own URL:

Swift

Copied to your clipboard
Identity.getUrlVariables { urlVariables, error in
if error != nil {
// handle error here
} else {
if let url = URL(string: "https://example.com?\(urlVariables ?? "")") {
DispatchQueue.main.async {
UIApplication.shared.open(url)
}
}
}
}

Objective-C

Copied to your clipboard
[AEPMobileIdentity getUrlVariables:^(NSString * _Nullable urlVariables, NSError *error) {
NSString *sampleURLString = @"https://example.com";
if (error != nil) {
// Handle variables being nil
} else {
NSString *stringWithData = [NSString stringWithFormat:@"%@?%@", sampleURLString, urlVariables];
NSURL *appendedUrl = [NSURL URLWithString:stringWithData];
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] openURL:appendedUrl options:@{} completionHandler:nil];
});
}
}];
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.