Identity API reference

appendToURL / appendVisitorInfoForURL

This API appends Adobe visitor information to the query component of the specified URL.
If the provided URL is null or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL and is returned in the callback function:
  • The adobe_mc attribute is a URL encoded list that contains:
    • MCMID - Experience Cloud ID (ECID)
    • MCORGID - Experience Cloud Org ID
    • MCAID - Analytics Tracking ID (AID), if available from the Analytics extension
    • TS - A timestamp taken when this request was made
  • The optional adobe_aa_vid attribute is the URL-encoded Analytics Custom Visitor ID (VID), if previously set in the Analytics extension.
This API is designed to handle the following URL formats:
1
scheme://authority/path?query=param#fragment
Copied!
In this example, the Adobe visitor data is appended as:
1
scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment
Copied!
Similarly, URLs without a query component:
1
scheme://authority/path#fragment
Copied!
The Adobe visitor data is appended as:
1
scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment
Copied!
If your application uses more complicated URLs, such as Angular URLs, you should use getUrlVariables.
Android
iOS (AEP 3.x)
iOS (ACP 2.x)
React Native
Flutter
Cordova
Unity
Xamarin

Java

This API can be called with AdobeCallback or AdobeCallbackWithError for retrieving the attributes from the Mobile SDK. When AdobeCallbackWithError is provided, this API uses a default timeout of 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.
Syntax
1
public static void appendVisitorInfoForURL(final String baseURL, final AdobeCallback<String> callback);
Copied!
  • baseUrl is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is invoked after the updated URL is available.
Example
1
Identity.appendVisitorInfoForURL("https://example.com", new AdobeCallback<String>() {
2
@Override
3
public void call(String urlWithAdobeVisitorInfo) {
4
//handle the new URL here
5
//For example, open the URL on the device browser
6
//
7
Intent i = new Intent(Intent.ACTION_VIEW);
8
i.setData(Uri.parse(urlWithAdobeVisitorInfo));
9
startActivity(i);
10
}
11
});
Copied!

Swift

Syntax
1
static func appendTo(url: URL?, completion: @escaping (URL?, Error?) -> Void)
Copied!
  • url is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • completion is invoked after the updated URL is available or Error if an unexpected exception occurs or the request times out. The returned Error contains the AEPError code of the specific error.
Example
1
Identity.appendTo(url: URL(string: "https://example.com")) { appendedURL, error in
2
if let error = error {
3
// handle error
4
} else {
5
// handle the appended url here
6
if let appendedURL = appendedURL {
7
// APIs which update the UI must be called from main thread
8
DispatchQueue.main.async {
9
self.webView.load(URLRequest(url: appendedURL!))
10
}
11
} else {
12
// handle error, nil appendedURL
13
}
14
}
15
})
Copied!

Objective-C

Syntax
1
+ (void) appendToUrl: (NSURL * _Nullable baseUrl) completion: ^(NSURL * _Nullable urlWithVisitorData, NSError * _Nullable error) completion;
Copied!
Example
1
NSURL* url = [NSURL URLWithString:@"https://example.com"];
2
[AEPMobileIdentity appendToUrl:url completion:^(NSURL * _Nullable urlWithVisitorData, NSError * _Nullable error) {
3
if (error) {
4
// handle error here
5
} else {
6
// handle the appended url here
7
if (urlWithVisitorData) {
8
// APIs which update the UI must be called from main thread
9
dispatch_async(dispatch_get_main_queue(), ^{
10
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
11
}
12
} else {
13
// handle error, nil urlWithVisitorData
14
}
15
}
16
}];
Copied!
Method appendToUrl:withCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

Swift

Syntax
1
static func append(to: URL?, withCallback: ((URL?) -> Void)?)
2
static func append(to: URL?, withCompletionHandler: ((URL?, Error?)-> Void)?)
Copied!
Example
1
ACPIdentity.append(to:URL(string: "https://example.com"), withCallback: {(appendedURL) in
2
// handle the appended url here
3
if let appendedURL = appendedURL {
4
// APIs which update the UI must be called from main thread
5
DispatchQueue.main.async {
6
self.webView.load(URLRequest(url: appendedURL!))
7
}
8
} else {
9
// handle error, nil appendedURL
10
}
11
});
12
13
ACPIdentity.append(to: URL(string: "https://example.com"), withCompletionHandler: { (appendedURL, error) in
14
if let error = error {
15
// handle error
16
} else {
17
// handle the appended url here
18
if let appendedURL = appendedURL {
19
// APIs which update the UI must be called from main thread
20
DispatchQueue.main.async {
21
self.webView.load(URLRequest(url: appendedURL!))
22
}
23
} else {
24
// handle error, nil appendedURL
25
}
26
}
27
})
Copied!

Objective-C

Syntax
1
+ (void) appendToUrl: (nullable NSURL*) baseUrl withCallback: (nullable void (^) (NSURL* __nullable urlWithVisitorData)) callback;
2
+ (void) appendToUrl: (nullable NSURL*) baseUrl withCompletionHandler: (nullable void (^) (NSURL* __nullable urlWithVersionData, NSError* __nullable error)) completionHandler;
Copied!
  • baseUrl is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is invoked after the updated URL is available.
  • completionHandler is invoked with urlWithVersionData after the updated URL is available or error if an unexpected exception occurs or the request times out. The returned NSError contains the ACPError code of the specific error. The default timeout of 500ms.
Example
1
NSURL* url = [[NSURL alloc] initWithString:@"https://example.com"];
2
[ACPIdentity appendToUrl:url withCallback:^(NSURL * _Nullable urlWithVisitorData) {
3
// handle the appended url here
4
if (urlWithVisitorData) {
5
// APIs which update the UI must be called from main thread
6
dispatch_async(dispatch_get_main_queue(), ^{
7
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
8
}
9
} else {
10
// handle error, nil urlWithVisitorData
11
}
12
}];
13
14
[ACPIdentity appendToUrl:url withCompletionHandler:^(NSURL * _Nullable urlWithVersionData, NSError * _Nullable error) {
15
if (error) {
16
// handle error here
17
} else {
18
// handle the appended url here
19
if (urlWithVisitorData) {
20
// APIs which update the UI must be called from main thread
21
dispatch_async(dispatch_get_main_queue(), ^{
22
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
23
}
24
} else {
25
// handle error, nil urlWithVisitorData
26
}
27
}
28
}];
Copied!

JavaScript

Syntax
1
appendVisitorInfoForURL(baseURL?: String): Promise<?string>;
Copied!
  • baseUrl is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
Example
1
ACPIdentity.appendVisitorInfoForURL("https://example.com").then(urlWithVistorData => console.log("AdobeExperenceSDK: Url with Visitor Data = " + urlWithVisitorData));
Copied!

Dart

Syntax
1
Future<String> appendToUrl (String url);
Copied!
  • url is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
Example
1
String result = "";
2
3
try {
4
result = await FlutterACPIdentity.appendToUrl("https://example.com");
5
} on PlatformException {
6
log("Failed to append URL");
7
}
Copied!

Cordova

Syntax
1
ACPIdentity.appendVisitorInfoForUrl = function(url, success, fail);
Copied!
  • url (String) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • success is a callback containing the provided URL with the visitor information appended if the appendVisitorInfoForUrl API executed without any errors.
  • fail is a callback containing error information if the appendVisitorInfoForUrl API was executed with errors.
Example
1
ACPIdentity.appendVisitorInfoForUrl("https://example.com", function(handleCallback) {
2
console.log("AdobeExperenceSDK: Url with Visitor Data = " + handleCallback);
3
}, function(handleError) {
4
console.log("AdobeExperenceSDK: Failed to append URL : " + handleError);
5
});
Copied!

C#

Syntax
1
public static void AppendToUrl(string url, AdobeIdentityAppendToUrlCallback callback)
Copied!
  • url (String) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendToUrl API executed without any errors.
Example
1
[MonoPInvokeCallback(typeof(AdobeIdentityAppendToUrlCallback))]
2
public static void HandleAdobeIdentityAppendToUrlCallback(string url)
3
{
4
print("Url is : " + url);
5
}
6
ACPIdentity.AppendToUrl("https://www.adobe.com", HandleAdobeIdentityAppendToUrlCallback);
Copied!

C#

iOS Syntax
1
public unsafe static void AppendToUrl (NSUrl baseUrl, Action<NSUrl> callback);
Copied!
  • baseUrl (NSUrl) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendToUrl API executed without any errors.
Android Syntax
1
public unsafe static void AppendVisitorInfoForURL (string baseURL, IAdobeCallback callback);
Copied!
  • baseURL (string) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendVisitorInfoForURL API executed without any errors.
iOS Example
1
ACPIdentity.AppendToUrl(url, callback => {
2
Console.WriteLine("Appended url: " + callback);
3
});
Copied!
Android Example
1
ACPIdentity.AppendVisitorInfoForURL("https://example.com", new StringCallback());
2
3
class StringCallback : Java.Lang.Object, IAdobeCallback
4
{
5
public void Call(Java.Lang.Object stringContent)
6
{
7
if (stringContent != null)
8
{
9
Console.WriteLine("Appended url: " + stringContent);
10
}
11
else
12
{
13
Console.WriteLine("null content in string callback");
14
}
15
}
16
}
Copied!

extensionVersion

The extensionVersion() API returns the version of the Identity extension that is registered with the Mobile Core extension.
To get the version of the Identity extension, use the following code sample:
Android
iOS (AEP 3.x)
iOS (ACP 2.x)
React Native
Flutter
Cordova
Unity
Xamarin

Java

1
String identityExtensionVersion = Identity.extensionVersion();
Copied!

Swift

Syntax
1
static var extensionVersion: String
Copied!
Example
1
let identityExtensionVersion = Identity.extensionVersion
Copied!

Objective-C

Syntax
1
+ (nonnull NSString*) extensionVersion;
Copied!
Example
1
NSString *identityVersion = [AEPMobileIdentity extensionVersion];
Copied!

Swift

Syntax
1
static func extensionVersion() -> String
Copied!
Example
1
let identityVersion = ACPIdentity.extensionVersion()
Copied!

Objective-C

Syntax
1
+ (nonnull NSString*) extensionVersion;
Copied!
Example
1
NSString *identityVersion = [ACPIdentity extensionVersion];
Copied!

JavaScript

1
ACPIdentity.extensionVersion().then(identityExtensionVersion => console.log("AdobeExperienceSDK: ACPIdentity version: " + identityExtensionVersion));
Copied!

Dart

1
String identityExtensionVersion = FlutterACPIdentity.extensionVersion;
Copied!

Cordova

Syntax
1
ACPIdentity.extensionVersion = function(success, fail);
Copied!
  • success is a callback containing the ACPIdentity extension version if the extensionVersion API executed without any errors.
  • fail is a callback containing error information if the appendVisitorInfoForUrl API was executed with errors.
Example
1
ACPIdentity.extensionVersion(function (handleCallback) {
2
console.log("AdobeExperienceSDK: ACPIdentity version: " + handleCallback)
3
}, function (handleError) {
4
console.log("AdobeExperenceSDK: failed to get extension version : " + handleError)
5
});
Copied!

C#

Syntax
1
public static string ExtensionVersion()
Copied!
Example
1
string identityVersion = ACPIdentity.ExtensionVersion();
Copied!

C#

Syntax
1
public static string ExtensionVersion ();
Copied!
Example
1
string identityVersion = ACPIdentity.ExtensionVersion();
Copied!

getExperienceCloudId

This API retrieves the Adobe Experience Cloud ID (ECID) that was generated when the app was initially launched and is stored in the Adobe Experience Cloud Identity Service.
This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.
Android
iOS (AEP 3.x)
iOS (ACP 2.x)
React Native
Flutter
Cordova
Unity
Xamarin

Java

This API can be called with AdobeCallback or AdobeCallbackWithError for retrieving the ECID from the Mobile SDK. When AdobeCallbackWithError is provided, this API uses a default timeout of 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.
Syntax
1
public static void getExperienceCloudId(final AdobeCallback<String> callback);
Copied!
  • callback is invoked after the ECID is available.
Example
1
Identity.getExperienceCloudId(new AdobeCallback<String>() {
2
@Override
3
public void call(String id) {
4
//Handle the ID returned here
5
}
6
});
Copied!

Swift

Syntax
1
@objc(getExperienceCloudId:)
2
static func getExperienceCloudId(completion: @escaping (String?, Error?) -> Void)
Copied!
  • completion is invoked with String after the ECID is available, or Error if an unexpected error occurs or the request times out. The returned Error contains the AEPError code of the specific error.
Example
1
Identity.getExperienceCloudId { ecid, error in
2
if let error = error {
3
// handle error here
4
} else {
5
// handle the retrieved ID here
6
}
7
}
Copied!

Objective-C

Syntax
1
+ (void) getExperienceCloudId: ^(NSString * _Nullable ecid, NSError * _Nullable error) completion;
Copied!
Example
1
[AEPMobileIdentity getExperienceCloudId:^(NSString * _Nullable ecid, NSError *error) {
2
if (error) {
3
// handle error here
4
} else {
5
// handle the retrieved ID here
6
}
7
}];
Copied!
Method getExperienceCloudIdWithCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

Swift

Syntax
1
static func getExperienceCloudId(_ callback: @escaping (String?) -> Void)
2
static func getExperienceCloudId(completionHandler: @escaping (String?, Error?) -> Void)
Copied!
  • callback is invoked after the ECID is available.
  • completionHandler is invoked with experienceCloudId after the ECID is available, or error if an unexpected error occurs or the request times out. The returned NSError contains the ACPError code of the specific error. The default timeout of 500ms.
Sample
1
ACPIdentity.getExperienceCloudId { (retrievedCloudId) in
2
// handle the retrieved ID here
3
}
4
5
ACPIdentity.getExperienceCloudId { (retrievedCloudId, error) in
6
if let error = error {
7
// handle error here
8
} else {
9
// handle the retrieved ID here
10
}
11
}
Copied!

Objective-C

Syntax
1
+ (void) getExperienceCloudId: (nonnull void (^) (NSString* __nullable experienceCloudId)) callback;
2
+ (void) getExperienceCloudIdWithCompletionHandler: (nonnull void (^) (NSString* __nullable experienceCloudId, NSError* __nullable error)) completionHandler;
Copied!
Example
1
[ACPIdentity getExperienceCloudId:^(NSString * _Nullable retrievedCloudId) {
2
// handle the retrieved ID here
3
}];
4
5
[ACPIdentity getExperienceCloudIdWithCompletionHandler:^(NSString * _Nullable experienceCloudId, NSError * _Nullable error) {
6
if (error) {
7
// handle error here
8
} else {
9
// handle the retrieved ID here
10
}
11
}];
Copied!

JavaScript

Syntax
1
getExperienceCloudId(): Promise<?string>;
Copied!
Example
1
ACPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
Copied!

Dart

Syntax
1
Future<String> experienceCloudId;
Copied!
Example
1
String result = "";
2
3
try {
4
result = await FlutterACPIdentity.experienceCloudId;
5
} on PlatformException {
6
log("Failed to get experienceCloudId");
7
}
Copied!

Cordova

Syntax
1
ACPIdentity.getExperienceCloudId(success, fail);
Copied!
  • success is a callback containing the ECID if the getExperienceCloudId API executed without any errors.
  • fail is a callback containing error information if the getExperienceCloudId API was executed with errors.
Example
1
ACPIdentity.getExperienceCloudId(function (handleCallback) {
2
console.log("AdobeExperienceSDK: experienceCloudId: " + handleCallback)
3
}, function (handleError) {
4
console.log("AdobeExperenceSDK: Failed to retrieve experienceCloudId : " + handleError);
5
});
Copied!

C#

Syntax
1
public static void GetExperienceCloudId(AdobeGetExperienceCloudIdCallback callback)
Copied!
  • callback is a callback containing the ECID if the GetExperienceCloudId API executed without any errors.
Example
1
[MonoPInvokeCallback(typeof(AdobeGetExperienceCloudIdCallback))]
2
public static void HandleAdobeGetExperienceCloudIdCallback(string cloudId)
3
{
4
print("ECID is : " + cloudId);
5
}
6
ACPIdentity.GetExperienceCloudId(HandleAdobeGetExperienceCloudIdCallback);
Copied!

C#

iOS Syntax
1
public unsafe static void GetExperienceCloudId (Action<NSString> callback);
Copied!
  • callback is a callback containing the ECID if the getExperienceCloudId API executed without any errors.
Android Syntax
1
public unsafe static void GetExperienceCloudId (IAdobeCallback callback);
Copied!
  • callback is a callback containing the ECID if the getExperienceCloudId API executed without any errors.
iOS Example
1
ACPIdentity.GetExperienceCloudId(callback => {
2
Console.WriteLine("Experience Cloud Id: " + callback);
3
});
Copied!
Android Example
1
ACPIdentity.GetExperienceCloudId(new StringCallback());
2
3
class StringCallback : Java.Lang.Object, IAdobeCallback
4
{
5
public void Call(Java.Lang.Object stringContent)
6
{
7
if (stringContent != null)
8
{
9
Console.WriteLine("Experience Cloud Id: " + stringContent);
10
}
11
else
12
{
13
Console.WriteLine("null content in string callback");
14
}
15
}
16
}
Copied!

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud Identity Service.
Android
iOS (AEP 3.x)
iOS (ACP 2.x)
React Native
Flutter
Cordova
Unity
Xamarin

Java

This API can be called with AdobeCallback or AdobeCallbackWithError for retrieving the custom identifiers from the Mobile SDK. When AdobeCallbackWithError is provided, this API uses a default timeout of 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.
Syntax
1
public static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
Copied!
  • callback is invoked after the customer identifiers are available.
Example
1
Identity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {
2
@Override
3
public void call(List<VisitorID> idList) {
4
//Process the IDs here
5
}
6
7
});
Copied!

Swift

Syntax
1
@objc(getIdentifiers:)
2
static func getIdentifiers(completion: @escaping ([Identifiable]?, Error?) -> Void)
Copied!
  • completion is invoked with a list of Identifiable objects after the customer identifiers are available, or Error if an unexpected error occurs or the request times out. The returned Error contains the AEPError code of the specific error.
Example
1
Identity.getIdentifiers { identifiers, error in
2
if let error = error {
3
// handle error here
4
} else {
5
// handle the retrieved identifiers here
6
}
7
}
Copied!

Objective-C

Syntax
1
+ (void) getIdentifiers: ^(NSArray<id<AEPIdentifiables>> * _Nullable identifiers, NSError * _Nullable error) completion;
Copied!
Example
1
[[AEPMobileIdentity getIdentifiers:^(NSArray<id<AEPIdentifiable>> * _Nullable identifiers, NSError *error) {
2
if (error) {
3
// handle error here
4
} else {
5
// handle the retrieved identifiers here
6
}
7
}];
Copied!
Method getIdentifiersWithCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

Swift

Syntax
1
static func getIdentifiers(_ callback: @escaping ([ACPMobileVisitorId]?) -> Void)
2
static func getIdentifiersWithCompletionHandler(_ completionHandler: @escaping ([ACPMobileVisitorId]?, Error?) -> Void)
Copied!
  • callback is invoked after the customer identifiers are available.
  • completionHandler is invoked with visitorIDs after the customer identifiers are available, or error if an unexpected error occurs or the request times out. The returned NSError contains the ACPError code of the specific error. The default timeout of 500ms.
Example
1
ACPIdentity.getIdentifiers { (retrievedVisitorIds) in
2
// handle the retrieved identifiers here
3
}
4
5
ACPIdentity.getIdentifiersWithCompletionHandler { (retrievedVisitorIds, error) in
6
if let error = error {
7
// handle error here
8
} else {
9
// handle the retrieved identifiers here
10
}
11
}
Copied!

Objective-C

Syntax
1
+ (void) getIdentifiers: (nonnull void (^) (NSArray<ADBMobileVisitorId*>* __nullable visitorIDs)) callback;
2
+ (void) getIdentifiersWithCompletionHandler: (nonnull void (^) (NSArray<ACPMobileVisitorId*>* __nullable visitorIDs, NSError* __nullable error)) completionHandler;
Copied!
Example
1
[ACPIdentity getIdentifiers:^(NSArray<ACPMobileVisitorId *> * _Nullable retrievedVisitorIds) {
2
// handle the retrieved identifiers here
3
}];
4
5
[ACPIdentity getIdentifiersWithCompletionHandler:^(NSArray<ACPMobileVisitorId *> * _Nullable visitorIDs, NSError * _Nullable error) {
6
if (error) {
7
// handle error here
8
} else {
9
// handle the retrieved identifiers here
10
}
11
}];
Copied!

JavaScript

Syntax
1
getIdentifiers(): Promise<Array<?ACPVisitorID>>;
Copied!
Example
1
ACPIdentity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));
Copied!

Dart

Syntax
1
Future<List<ACPMobileVisitorId>> identifiers;
Copied!
Example
1
List<ACPMobileVisitorId> result;
2
3
try {
4
result = await FlutterACPIdentity.identifiers;
5
} on PlatformException {
6
log("Failed to get identifiers");
7
}
Copied!

Cordova

Syntax
1
ACPIdentity.getIdentifiers(success, fail);
Copied!
  • success is a callback containing the previously synced identifiers if the getIdentifiers API executed without any errors.
  • fail is a callback containing error information if the getIdentifiers API was executed with errors.
Example
1
ACPIdentity.getIdentifiers(function (handleCallback) {
2
console.log("AdobeExperienceSDK: Visitor identifiers: " + handleCallback);
3
}, function (handleError) {
4
console.log("AdobeExperenceSDK: Failed to retrieve visitor identifiers : " + handleError);
5
});
Copied!

C#

Syntax
1
public static void GetIdentifiers(AdobeGetIdentifiersCallback callback)
Copied!
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.
Example
1
[MonoPInvokeCallback(typeof(AdobeGetIdentifiersCallback))]
2
public static void HandleAdobeGetIdentifiersCallback(string visitorIds)
3
{
4
print("Ids is : " + visitorIds);
5
}
6
ACPIdentity.GetIdentifiers(HandleAdobeGetIdentifiersCallback);
Copied!

C#

iOS Syntax
1
public unsafe static void GetIdentifiers (Action<ACPMobileVisitorId[]> callback);
Copied!
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.
Android Syntax
1
public unsafe static void GetIdentifiers (IAdobeCallback callback);
Copied!
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.
iOS Example
1
Action<ACPMobileVisitorId[]> callback = new Action<ACPMobileVisitorId[]>(handleCallback);
2
ACPIdentity.GetIdentifiers(callback);
3
4
private void handleCallback(ACPMobileVisitorId[] ids)
5
{
6
String visitorIdsString = "[]";
7
if (ids.Length != 0)
8
{
9
visitorIdsString = "";
10
foreach (ACPMobileVisitorId id in ids)
11
{
12
visitorIdsString = visitorIdsString + "[Id: " + id.Identifier + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.AuthenticationState + "]";
13
}
14
}
15
Console.WriteLine("Retrieved visitor ids: " + visitorIdsString);
16
}
Copied!
Android Example
1
ACPIdentity.GetIdentifiers(new GetIdentifiersCallback());
2
3
class GetIdentifiersCallback : Java.Lang.Object, IAdobeCallback
4
{
5
public void Call(Java.Lang.Object retrievedIds)
6
{
7
System.String visitorIdsString = "[]";
8
if (retrievedIds != null)
9
{
10
var ids = GetObject<JavaList>(retrievedIds.Handle, JniHandleOwnership.DoNotTransfer);
11
if (ids != null && ids.Count > 0)
12
{
13
visitorIdsString = "";
14
foreach (VisitorID id in ids)
15
{
16
visitorIdsString = visitorIdsString + "[Id: " + id.Id + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.GetAuthenticationState() + "]";
17
}
18
}
19
}
20
Console.WriteLine("Retrieved visitor ids: " + visitorIdsString);
21
}
22
}
Copied!

getUrlVariables

This API gets the Adobe Experience Cloud Identity Service variables in URL query parameter form, and these variables will be consumed by the hybrid app. This method returns an appropriately formed string that contains the Experience Cloud Identity Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting URL in the correct location.
If an error occurs while retrieving the URL string, the callback handler will be called with a null value. Otherwise, the following information is added to the string that is returned in the callback:
  • The adobe_mc attribute is an URL encoded list that contains:
    • MCMID - Experience Cloud ID (ECID)
    • MCORGID - Experience Cloud Org ID
    • MCAID - Analytics Tracking ID (AID), if available from the Analytics extension