Identity API reference

appendVisitorInfoForURL

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

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 AdobeCallback instance:

  • 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.

When AdobeCallbackWithError is provided, and you are fetching the attributes from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate [AdobeError]https://aep-sdks.gitbook.io/docs/using-mobile-extensions/mobile-core/mobile-core-api-reference#adobeerror).

Java

appendVisitorInfoForURL

Syntax

public static void appendVisitorInfoForURL(final String baseURL, final AdobeCallback<String> callback);
  • 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

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);
}
});

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs, such as Angular URLs, we recommend that you use getUrlVariables.

iOS

appendToURL

Method appendToUrl:withCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

This API appends Adobe visitor information to the query component of the specified URL.

If the provided URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL string and is returned via the callback:

  • 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.

iOS

Syntax

+ (void) appendToUrl: (nullable NSURL*) baseUrl withCallback: (nullable void (^) (NSURL* __nullable urlWithVisitorData)) callback;
+ (void) appendToUrl: (nullable NSURL*) baseUrl withCompletionHandler: (nullable void (^) (NSURL* __nullable urlWithVersionData, NSError* __nullable error)) completionHandler;
  • 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 is 500ms.

Examples

Objective-C

NSURL* url = [[NSURL alloc] initWithString:@"https://example.com"];
[ACPIdentity appendToUrl:url withCallback:^(NSURL * _Nullable urlWithVisitorData) {
// handle the appended url here
if (urlWithVisitorData) {
// APIs which update the UI must be called from main thread
dispatch_async(dispatch_get_main_queue(), ^{
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
}
} else {
// handle error, nil urlWithVisitorData
}
}];
[ACPIdentity appendToUrl:url withCompletionHandler:^(NSURL * _Nullable urlWithVersionData, NSError * _Nullable error) {
if (error) {
// handle error here
} else {
// handle the appended url here
if (urlWithVisitorData) {
// APIs which update the UI must be called from main thread
dispatch_async(dispatch_get_main_queue(), ^{
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
}
} else {
// handle error, nil urlWithVisitorData
}
}
}];

Swift

ACPIdentity.append(to:URL(string: "https://example.com"), withCallback: {(appendedURL) in
// handle the appended url here
if let appendedURL = appendedURL {
// APIs which update the UI must be called from main thread
DispatchQueue.main.async {
self.webView.load(URLRequest(url: appendedURL!))
}
} else {
// handle error, nil appendedURL
}
});
ACPIdentity.append(to: URL(string: "https://example.com"), withCompletionHandler: { (appendedURL, error) in
if let error = error {
// handle error
} else {
// handle the appended url here
if let appendedURL = appendedURL {
// APIs which update the UI must be called from main thread
DispatchQueue.main.async {
self.webView.load(URLRequest(url: appendedURL!))
}
} else {
// handle error, nil appendedURL
}
}
})

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs, such as Angular URLs, we recommend that you use getUrlVariables.

React Native

appendVisitorInfoForURL

This API appends Adobe visitor information to the query component of the specified URL.

If the specified URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL.

  • 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.

JavaScript

Syntax

appendVisitorInfoForURL(baseURL?: String): Promise<?string>;
  • 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

ACPIdentity.appendVisitorInfoForURL("https://example.com").then(urlWithVistorData => console.log("AdobeExperenceSDK: Url with Visitor Data = " + urlWithVisitorData));

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs, such as Angular URLs, we recommend that you use getUrlVariables.

Flutter

appendVisitorInfoForURL

This API appends Adobe visitor information to the query component of the specified URL.

If the specified URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL.

  • 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.

Dart

Syntax

Future<String> appendToUrl (String url);
  • 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

String result = "";
try {
result = await FlutterACPIdentity.appendToUrl("https://example.com");
} on PlatformException {
log("Failed to append URL");
}

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs, such as Angular URLs, we recommend that you use getUrlVariables.

Cordova

appendVisitorInfoForURL

This API appends Adobe visitor information to the query component of the specified URL.

If the specified URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL.

  • 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.

Cordova

Syntax

ACPIdentity.appendVisitorInfoForUrl = function(url, success, fail);
  • 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

ACPIdentity.appendVisitorInfoForUrl("https://example.com", function(handleCallback) {
console.log("AdobeExperenceSDK: Url with Visitor Data = " + handleCallback);
}, function(handleError) {
console.log("AdobeExperenceSDK: Failed to append URL : " + handleError);
});

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs we recommend that you use getUrlVariables.

Unity

AppendToUrl

This API appends Adobe visitor information to the query component of the specified URL.

If the specified URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL.

  • 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.

C#

Syntax

public static void AppendToUrl(string url, AdobeIdentityAppendToUrlCallback callback)
  • 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

[MonoPInvokeCallback(typeof(AdobeIdentityAppendToUrlCallback))]
public static void HandleAdobeIdentityAppendToUrlCallback(string url)
{
print("Url is : " + url);
}
ACPIdentity.AppendToUrl("https://www.adobe.com", HandleAdobeIdentityAppendToUrlCallback);

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&[email protected]#fragment

If your application uses more complicated URLs we recommend that you use GetUrlVariables.

Xamarin

AppendToUrl

This API appends Adobe visitor information to the query component of the specified URL.

If the specified URL is nil or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL.

  • 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.

C#

iOS Syntax

public unsafe static void AppendToUrl (NSUrl baseUrl, Action<NSUrl> callback);
  • 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

public unsafe static void AppendVisitorInfoForURL (string baseURL, IAdobeCallback callback);
  • 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

ACPIdentity.AppendToUrl(url, callback => {
Console.WriteLine("Appended url: " + callback);
});

Android Example

ACPIdentity.AppendVisitorInfoForURL("https://example.com", new StringCallback());
class StringCallback : Java.Lang.Object, IAdobeCallback
{
public void Call(Java.Lang.Object stringContent)
{
if (stringContent != null)
{
Console.WriteLine("Appended url: " + stringContent);
}
else
{
Console.WriteLine("null content in string callback");
}
}
}

This API is designed to handle the following URL formats:

scheme://authority/path?query=param#fragment

In this example, the Adobe visitor data is appended as:

scheme://authority/path?query=param&TS=timestamp&MCMID=ecid&MCORGID=[email protected]#fragment

Similarly, URLs without a query component:

scheme://authority/path#fragment

The Adobe visitor data is appended as:

scheme://authority/path?TS=timestamp&MCMID=ecid&MCORGID=[email protected]#fragment

If your application uses more complicated URLs we recommend that you use GetUrlVariables.

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
React Native
Flutter
Cordova
Unity
Xamarin
Android

Java

String identityExtensionVersion = Identity.extensionVersion();
iOS

iOS

Objective-C

NSString *identityExtensionVersion = [ACPIdentity extensionVersion];

Swift

var identityExtensionVersion = ACPIdentity.extensionVersion()
React Native

JavaScript

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

Dart

String identityExtensionVersion = FlutterACPIdentity.extensionVersion;
Cordova

Cordova

Syntax

ACPIdentity.extensionVersion = function(success, fail);
  • 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

ACPIdentity.extensionVersion(function (handleCallback) {
console.log("AdobeExperienceSDK: ACPIdentity version: " + handleCallback)
}, function (handleError) {
console.log("AdobeExperenceSDK: failed to get extension version : " + handleError)
});
Unity

C#

Syntax

public static string ExtensionVersion()

Example

string identityVersion = ACPIdentity.ExtensionVersion();
Xamarin

C#

Syntax

public static string ExtensionVersion ();

Example

string identityVersion = ACPIdentity.ExtensionVersion();

getExperienceCloudId

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. The values are returned via the [AdobeCallback]https://aep-sdks.gitbook.io/docs/using-mobile-extensions/mobile-core/mobile-core-api-reference#adobecallback).

When AdobeCallbackWithError is provided, and you are fetching the ECID from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.

Java

Syntax

public static void getExperienceCloudId(final AdobeCallback<String> callback);
  • callback is invoked after the ECID is available.

Example

Identity.getExperienceCloudId(new AdobeCallback<String>() {
@Override
public void call(String id) {
//Handle the ID returned here
}
});
iOS

getExperienceCloudId

Method getExperienceCloudIdWithCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. The values are returned via the callback.

Syntax

+ (void) getExperienceCloudId: (nonnull void (^) (NSString* __nullable experienceCloudId)) callback;
+ (void) getExperienceCloudIdWithCompletionHandler: (nonnull void (^) (NSString* __nullable experienceCloudId, NSError* __nullable error)) completionHandler;
  • 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 is 500ms.

Examples

Objective-C

[ACPIdentity getExperienceCloudId:^(NSString * _Nullable retrievedCloudId) {
// handle the retrieved ID here
}];
[ACPIdentity getExperienceCloudIdWithCompletionHandler:^(NSString * _Nullable experienceCloudId, NSError * _Nullable error) {
if (error) {
// handle error here
} else {
// handle the retrieved ID here
}
}];

Swift

ACPIdentity.getExperienceCloudId { (retrievedCloudId) in
// handle the retrieved ID here
}
ACPIdentity.getExperienceCloudId { (retrievedCloudId, error) in
if let error = error {
// handle error here
} else {
// handle the retrieved ID here
}
}
React Native

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

JavaScript

Syntax

getExperienceCloudId(): Promise<?string>;

Example

ACPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
Flutter

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

Dart

Syntax

Future<String> experienceCloudId;

Example

String result = "";
try {
result = await FlutterACPIdentity.experienceCloudId;
} on PlatformException {
log("Failed to get experienceCloudId");
}
Cordova

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

Cordova

Syntax

ACPIdentity.getExperienceCloudId(success, fail);
  • success is a callback containing the experience cloud id if the getExperienceCloudId API executed without any errors.

  • fail is a callback containing error information if the getExperienceCloudId API was executed with errors.

Example

ACPIdentity.getExperienceCloudId(function (handleCallback) {
console.log("AdobeExperienceSDK: experienceCloudId: " + handleCallback)
}, function (handleError) {
console.log("AdobeExperenceSDK: Failed to retrieve experienceCloudId : " + handleError);
});
Unity

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

C#

Syntax

public static void GetExperienceCloudId(AdobeGetExperienceCloudIdCallback callback)
  • callback is a callback containing the experience cloud id if the GetExperienceCloudId API executed without any errors.

Example

[MonoPInvokeCallback(typeof(AdobeGetExperienceCloudIdCallback))]
public static void HandleAdobeGetExperienceCloudIdCallback(string cloudId)
{
print("ECID is : " + cloudId);
}
ACPIdentity.GetExperienceCloudId(HandleAdobeGetExperienceCloudIdCallback);
Xamarin

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched and is stored in the ECID Service.

This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

C#

iOS Syntax

public unsafe static void GetExperienceCloudId (Action<NSString> callback);
  • callback is a callback containing the experience cloud id if the getExperienceCloudId API executed without any errors.

Android Syntax

public unsafe static void GetExperienceCloudId (IAdobeCallback callback);
  • callback is a callback containing the experience cloud id if the getExperienceCloudId API executed without any errors.

iOS Example

ACPIdentity.GetExperienceCloudId(callback => {
Console.WriteLine("Experience cloud id: " + callback);
});

Android Example

ACPIdentity.GetExperienceCloudId(new StringCallback());
class StringCallback : Java.Lang.Object, IAdobeCallback
{
public void Call(Java.Lang.Object stringContent)
{
if (stringContent != null)
{
Console.WriteLine("Experience cloud id: " + stringContent);
}
else
{
Console.WriteLine("null content in string callback");
}
}
}

getIdentifiers

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud through the AdobeCallback.

When AdobeCallbackWithError is provided, and you are fetching the custom identifiers from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.

Java

Syntax

public static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
  • callback is invoked after the customer identifiers are available.

Example

Identity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {
@Override
public void call(List<VisitorID> idList) {
//Process the IDs here
}
});
iOS

getIdentifiers

Method getIdentifiersWithCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

This getIdentifiers API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

iOS

Syntax

+ (void) getIdentifiers: (nonnull void (^) (NSArray<ADBMobileVisitorId*>* __nullable visitorIDs)) callback;
+ (void) getIdentifiersWithCompletionHandler: (nonnull void (^) (NSArray<ACPMobileVisitorId*>* __nullable visitorIDs, NSError* __nullable error)) completionHandler;
  • 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 is 500ms.

Examples

Objective-C

[ACPIdentity getIdentifiers:^(NSArray<ACPMobileVisitorId *> * _Nullable retrievedVisitorIds) {
// handle the retrieved identifiers here
}];
[ACPIdentity getIdentifiersWithCompletionHandler:^(NSArray<ACPMobileVisitorId *> * _Nullable visitorIDs, NSError * _Nullable error) {
if (error) {
// handle error here
} else {
// handle the retrieved identifiers here
}
}];

Swift

ACPIdentity.getIdentifiers { (retrievedVisitorIds) in
// handle the retrieved identifiers here
}
ACPIdentity.getIdentifiersWithCompletionHandler { (retrievedVisitorIds, error) in
if let error = error {
// handle error here
} else {
// handle the retrieved identifiers here
}
}
React Native

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

JavaScript

Syntax

getIdentifiers(): Promise<Array<?ACPVisitorID>>;

Example

ACPIdentity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));
Flutter

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

Dart

Syntax

Future<List<ACPMobileVisitorId>> identifiers;

Example

List<ACPMobileVisitorId> result;
try {
result = await FlutterACPIdentity.identifiers;
} on PlatformException {
log("Failed to get identifiers");
}
Cordova

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

Cordova

Syntax

ACPIdentity.getIdentifiers(success, fail);
  • 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

ACPIdentity.getIdentifiers(function (handleCallback) {
console.log("AdobeExperienceSDK: Visitor identifiers: " + handleCallback);
}, function (handleError) {
console.log("AdobeExperenceSDK: Failed to retrieve visitor identifiers : " + handleError);
});
Unity

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

C#

Syntax

public static void GetIdentifiers(AdobeGetIdentifiersCallback callback)
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.

Example

[MonoPInvokeCallback(typeof(AdobeGetIdentifiersCallback))]
public static void HandleAdobeGetIdentifiersCallback(string visitorIds)
{
print("Ids is : " + visitorIds);
}
ACPIdentity.GetIdentifiers(HandleAdobeGetIdentifiersCallback);
Xamarin

getIdentifiers

This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud.

C#

iOS Syntax

public unsafe static void GetIdentifiers (Action<ACPMobileVisitorId[]> callback);
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.

Android Syntax

public unsafe static void GetIdentifiers (IAdobeCallback callback);
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.

iOS Example

Action<ACPMobileVisitorId[]> callback = new Action<ACPMobileVisitorId[]>(handleCallback);
ACPIdentity.GetIdentifiers(callback);
private void handleCallback(ACPMobileVisitorId[] ids)
{
String visitorIdsString = "[]";
if (ids.Length != 0)
{
visitorIdsString = "";
foreach (ACPMobileVisitorId id in ids)
{
visitorIdsString = visitorIdsString + "[Id: " + id.Identifier + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.AuthenticationState + "]";
}
}
Console.WriteLine("Retrieved visitor ids: " + visitorIdsString);
}

Android Example

ACPIdentity.GetIdentifiers(new GetIdentifiersCallback());
class GetIdentifiersCallback : Java.Lang.Object, IAdobeCallback
{
public void Call(Java.Lang.Object retrievedIds)
{
System.String visitorIdsString = "[]";
if (retrievedIds != null)
{
var ids = GetObject<JavaList>(retrievedIds.Handle, JniHandleOwnership.DoNotTransfer);
if (ids != null && ids.Count > 0)
{
visitorIdsString = "";
foreach (VisitorID id in ids)
{
visitorIdsString = visitorIdsString + "[Id: " + id.Id + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.GetAuthenticationState() + "]";
}
}
}
Console.WriteLine("Retrieved visitor ids: " + visitorIdsString);
}
}

getUrlVariables

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

getUrlVariables

This method was added in Core version 1.4.0 and Identity version 1.1.0.

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback will be called with a null value. Otherwise, the following information is added to the string that is returned in the callback as an AdobeCallback instance:

  • 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

    • 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.

When AdobeCallbackWithError is provided, and you are fetching the attributes from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.

Java

Syntax

public static void getUrlVariables(final AdobeCallback<String> callback);
  • callback has an NSString value that contains the visitor identifiers as a querystring after the service request is complete.

Example

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);
}
});
iOS

getUrlVariables

Method getUrlVariables was added in ACPCore version 2.3.0 and ACPIdentity version 2.1.0. Method getUrlVariablesWithCompletionHandler was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

iOS

Syntax

+ (void) getUrlVariables: (nonnull void (^) (NSString* __nullable urlVariables)) callback;
+ (void) getUrlVariablesWithCompletionHandler: (nonnull void (^) (NSString* __nullable urlVariables, NSError* __nullable error)) completionHandler;
  • callback has an NSString value that contains the visitor identifiers as a querystring after the service request is complete.

  • completionHandler is invoked with urlVariables containing the visitor identifiers as a query string, 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 is 500ms.

Examples

Objective-C

[ACPIdentity getUrlVariables:^(NSString * _Nullable urlVariables) {
// handle the URL query parameter string here
NSString* urlString = @"https://example.com";
NSString* urlStringWithVisitorData = [NSString stringWithFormat:@"%@?%@", urlString, urlVariables];
NSURL* urlWithVisitorData = [NSURL URLWithString:urlStringWithVisitorData];
// APIs which update the UI must be called from main thread
dispatch_async(dispatch_get_main_queue(), ^{
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
}
}];
[ACPIdentity getUrlVariablesWithCompletionHandler:^(NSString * _Nullable urlVariables, NSError * _Nullable error) {
if (error) {
// handle error here
} else {
// handle the URL query parameter string here
NSString* urlString = @"https://example.com";
NSString* urlStringWithVisitorData = [NSString stringWithFormat:@"%@?%@", urlString, urlVariables];
NSURL* urlWithVisitorData = [NSURL URLWithString:urlStringWithVisitorData];
// APIs which update the UI must be called from main thread
dispatch_async(dispatch_get_main_queue(), ^{
[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];
}
}
}];

Swift

ACPIdentity.getUrlVariables {(urlVariables) in
var urlStringWithVisitorData: String = "https://example.com"
if let urlVariables: String = urlVariables {
urlStringWithVisitorData.append("?" + urlVariables)
}
guard let urlWithVisitorData: URL = URL(string: urlStringWithVisitorData) else {
// handle error, unable to construct URL
return
}
// APIs which update the UI must be called from main thread
DispatchQueue.main.async {
self.webView.load(URLRequest(url: urlWithVisitorData))
}
}
ACPIdentity.getUrlVariables { (urlVariables, error) in
if let error = error {
// handle error
} else {
var urlStringWithVisitorData: String = "https://example.com"
if let urlVariables: String = urlVariables {
urlStringWithVisitorData.append("?" + urlVariables)
}
guard let urlWithVisitorData: URL = URL(string: urlStringWithVisitorData) else {
// handle error, unable to construct URL
return
}
// APIs which update the UI must be called from main thread
DispatchQueue.main.async {
self.webView.load(URLRequest(url: urlWithVisitorData))
}
}
}
React Native

JavaScript

This method was added in react-native-acpcore v1.0.5.

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

Syntax

getUrlVariables(): Promise<?string>;

Example

ACPIdentity.getUrlVariables().then(urlVariables => console.log("AdobeExperenceSDK: query params = " + urlVariables));
Flutter

getUrlVariables

Dart

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

Syntax

Future<String> urlVariables;

Example

String result = "";
try {
result = await FlutterACPIdentity.urlVariables;
} on PlatformException {
log("Failed to get url variables");
}
Cordova

Cordova

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

Syntax

ACPIdentity.getUrlVariables(success, fail);
  • success is a callback containing the url varaibles in query parameter form if the getUrlVariables API executed without any errors.

  • fail is a callback containing error information if the getUrlVariables API was executed with errors.

Example

ACPIdentity.getUrlVariables(function (handleCallback) {
console.log("AdobeExperienceSDK: Url variables: " + handleCallback);
}, function (handleError) {
console.log("AdobeExperenceSDK: Failed to retrieve url variables : " + handleError);
});
Unity

C#

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

Syntax

public static void GetUrlVariables(AdobeGetUrlVariables callback)
  • callback is a callback containing the url varaibles in query parameter form if the GetUrlVariables API executed without any errors.

Example

[MonoPInvokeCallback(typeof(AdobeGetUrlVariables))]
public static void HandleAdobeGetUrlVariables(string urlVariables)
{
print("Url variables are : " + urlVariables);
}
ACPIdentity.GetUrlVariables(HandleAdobeGetUrlVariables);
Xamarin

C#

This API gets the Visitor ID 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 Visitor ID Service URL variables. There will be no leading (&) or (?) punctuation because the caller is responsible for placing the variables in their resulting java.net.URI in the correct location.

If an error occurs while retrieving the URL string, callback 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

    • 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.

iOS Syntax

public unsafe static void GetUrlVariables (Action<NSString> callback);
  • callback is a callback containing the url varaibles in query parameter form if the GetUrlVariables API executed without any errors.

Android Syntax

public unsafe static void GetUrlVariables (IAdobeCallback callback);
  • callback is a callback containing the url varaibles in query parameter form if the GetUrlVariables API executed without any errors.

iOS Example

ACPIdentity.GetUrlVariables(callback => {
Console.WriteLine("Url variables: " + callback);
});

Android Example

ACPIdentity.GetUrlVariables(new StringCallback());
class StringCallback : Java.Lang.Object, IAdobeCallback
{
public void Call(Java.Lang.Object stringContent)
{
if (stringContent != null)
{
Console.WriteLine("Url variables: " + stringContent);
}
else
{
Console.WriteLine("null content in string callback");
}
}
}

registerExtension

The registerExtension() API registers the Identity extension with the Mobile Core extension. This API allows the extension to send and receive events to and from the Mobile SDK.

To register the Identity extension, use the following code sample:

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

After calling the setApplication() method in the onCreate() method, register the extension. If the registration was not successful, an InvalidInitException is thrown.

Java

public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
try {
Identity.registerExtension();
} catch (Exception e) {
//Log the exception
}
}
}
iOS

iOS

Register the Identity extension in your app's didFinishLaunchingWithOptions function:

Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ACPIdentity registerExtension];
// Override point for customization after application launch.
return YES;
}

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACPIdentity.registerExtension();
// Override point for customization after application launch.
return true;
}
React Native

JavaScript

When using React Native, registering Identity with Mobile Core should be done in native code which is shown under the Android and iOS tabs.

Flutter

Dart

When using Flutter, registering Identity with Mobile Core should be done in native code which is shown under the Android and iOS tabs.

Cordova

Cordova

When using Cordova, registering Identity with Mobile Core should be done in native code which is shown under the Android and iOS tabs.

Unity

C#

Register the Identity extension in your app's Start() function:

void Start() {
ACPIdentity.RegisterExtension();
}
Xamarin

C#

iOS

Register the Identity extension in your app's FinishedLaunching() function:

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
ACPIdentity.RegisterExtension();
// start core
ACPCore.Start(startCallback);
return base.FinishedLaunching(app, options);
}

Android

Register the Identity extension in your app's OnCreate() function:

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
ACPIdentity.RegisterExtension();
// start core
ACPCore.Start(new CoreStartCompletionCallback());
}

setAdvertisingIdentifier

The advertising ID is preserved between app upgrades, is saved and restored during the standard application backup process, available via Signals, and is removed at uninstall.

If the current SDK privacy status is optedout, the advertising identifier is not set or stored.

Android
iOS
React Native
Flutter
Cordova
Unity
Xamarin
Android

setAdvertisingIdentifier

This API sets the provided advertising identifier.

Java

Syntax

public static void setAdvertisingIdentifier(final String advertisingIdentifier);
  • advertisingIdentifier is a string that provides developers with a simple, standard system to track the Ads through their apps.

Example

This is just an implementation example. For more information about advertising identifiers and how to handle them correctly in your mobile application, see Google Play Services documentation about Advertising ID.

This example requires Google Play Services to be configured in your mobile application. For instructions on how to import the Google Mobile Ads SDK and how to configure your ApplicationManifest.xml file, see