Identity API reference
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
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 IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- 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:
Copied to your clipboardscheme://authority/path?query=param#fragment
In this example, the Adobe visitor data is appended as:
Copied to your clipboardscheme://authority/path?query=param&adobe_mc=TS%3Dtimestamp%7CMCMID%3Decid%7CMCORGID%3Decorgid%40AdobeOrg#fragment
Similarly, URLs without a query component:
Copied to your clipboardscheme://authority/path#fragment
The Adobe visitor data is appended as:
Copied to your clipboardscheme://authority/path?adobe_mc=TS%3Dtimestamp%7CMCMID%3Decid%7CMCORGID%3Decorgid%40AdobeOrg#fragment
In these examples the adobe_mc
parameters are separated by "|" (pipe) and are encoded.
Copied to your clipboardadobe_mc = TS=XXXXXX|MCMID=XXXXXX|MCAID=XXXXXX|MCORGID=XXXXXX@AdobeOrg
If your application uses more complicated URLs, such as Angular URLs, you should use getUrlVariables.
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
Copied to your clipboardpublic 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
Copied to your clipboardIdentity.appendVisitorInfoForURL("https://example.com", new AdobeCallback<String>() {@Overridepublic 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);}});
Method appendToUrl:withCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func append(to: URL?, withCallback: ((URL?) -> Void)?)static func append(to: URL?, withCompletionHandler: ((URL?, Error?)-> Void)?)
Example
Copied to your clipboardACPIdentity.append(to:URL(string: "https://example.com"), withCallback: {(appendedURL) in// handle the appended url hereif let appendedURL = appendedURL {// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: appendedURL!))}} else {// handle error, nil appendedURL}});ACPIdentity.append(to: URL(string: "https://example.com"), withCompletionHandler: { (appendedURL, error) inif let error = error {// handle error} else {// handle the appended url hereif let appendedURL = appendedURL {// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: appendedURL!))}} else {// handle error, nil appendedURL}}})
Objective-C
Syntax
Copied to your clipboard+ (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 of 500ms.
Example
Copied to your clipboardNSURL* url = [[NSURL alloc] initWithString:@"https://example.com"];[ACPIdentity appendToUrl:url withCallback:^(NSURL * _Nullable urlWithVisitorData) {// handle the appended url hereif (urlWithVisitorData) {// APIs which update the UI must be called from main threaddispatch_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 hereif (urlWithVisitorData) {// APIs which update the UI must be called from main threaddispatch_async(dispatch_get_main_queue(), ^{[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];}} else {// handle error, nil urlWithVisitorData}}}];
JavaScript
Syntax
Copied to your clipboardappendVisitorInfoForURL(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
Copied to your clipboardACPIdentity.appendVisitorInfoForURL("https://example.com").then(urlWithVistorData => console.log("AdobeExperenceSDK: Url with Visitor Data = " + urlWithVisitorData));
Dart
Syntax
Copied to your clipboardFuture<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
Copied to your clipboardString result = "";try {result = await FlutterACPIdentity.appendToUrl("https://example.com");} on PlatformException {log("Failed to append URL");}
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.appendVisitorInfoForUrl("https://example.com", function(handleCallback) {console.log("AdobeExperenceSDK: Url with Visitor Data = " + handleCallback);}, function(handleError) {console.log("AdobeExperenceSDK: Failed to append URL : " + handleError);});
C#
Syntax
Copied to your clipboardpublic 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
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeIdentityAppendToUrlCallback))]public static void HandleAdobeIdentityAppendToUrlCallback(string url){print("Url is : " + url);}ACPIdentity.AppendToUrl("https://www.adobe.com", HandleAdobeIdentityAppendToUrlCallback);
C#
iOS syntax
Copied to your clipboardpublic 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
Copied to your clipboardpublic 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
Copied to your clipboardACPIdentity.AppendToUrl(url, callback => {Console.WriteLine("Appended url: " + callback);});
Android example
Copied to your clipboardACPIdentity.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");}}}
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
Copied to your clipboardpublic 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
Copied to your clipboardIdentity.appendVisitorInfoForURL("https://example.com", new AdobeCallback<String>() {@Overridepublic 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);}});
Method appendToUrl:withCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func append(to: URL?, withCallback: ((URL?) -> Void)?)static func append(to: URL?, withCompletionHandler: ((URL?, Error?)-> Void)?)
Example
Copied to your clipboardACPIdentity.append(to:URL(string: "https://example.com"), withCallback: {(appendedURL) in// handle the appended url hereif let appendedURL = appendedURL {// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: appendedURL!))}} else {// handle error, nil appendedURL}});ACPIdentity.append(to: URL(string: "https://example.com"), withCompletionHandler: { (appendedURL, error) inif let error = error {// handle error} else {// handle the appended url hereif let appendedURL = appendedURL {// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: appendedURL!))}} else {// handle error, nil appendedURL}}})
Objective-C
Syntax
Copied to your clipboard+ (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 of 500ms.
Example
Copied to your clipboardNSURL* url = [[NSURL alloc] initWithString:@"https://example.com"];[ACPIdentity appendToUrl:url withCallback:^(NSURL * _Nullable urlWithVisitorData) {// handle the appended url hereif (urlWithVisitorData) {// APIs which update the UI must be called from main threaddispatch_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 hereif (urlWithVisitorData) {// APIs which update the UI must be called from main threaddispatch_async(dispatch_get_main_queue(), ^{[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];}} else {// handle error, nil urlWithVisitorData}}}];
JavaScript
Syntax
Copied to your clipboardappendVisitorInfoForURL(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
Copied to your clipboardACPIdentity.appendVisitorInfoForURL("https://example.com").then(urlWithVistorData => console.log("AdobeExperenceSDK: Url with Visitor Data = " + urlWithVisitorData));
Dart
Syntax
Copied to your clipboardFuture<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
Copied to your clipboardString result = "";try {result = await FlutterACPIdentity.appendToUrl("https://example.com");} on PlatformException {log("Failed to append URL");}
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.appendVisitorInfoForUrl("https://example.com", function(handleCallback) {console.log("AdobeExperenceSDK: Url with Visitor Data = " + handleCallback);}, function(handleError) {console.log("AdobeExperenceSDK: Failed to append URL : " + handleError);});
C#
Syntax
Copied to your clipboardpublic 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
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeIdentityAppendToUrlCallback))]public static void HandleAdobeIdentityAppendToUrlCallback(string url){print("Url is : " + url);}ACPIdentity.AppendToUrl("https://www.adobe.com", HandleAdobeIdentityAppendToUrlCallback);
C#
iOS syntax
Copied to your clipboardpublic 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
Copied to your clipboardpublic 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
Copied to your clipboardACPIdentity.AppendToUrl(url, callback => {Console.WriteLine("Appended url: " + callback);});
Android example
Copied to your clipboardACPIdentity.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");}}}
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:
Swift
Syntax
Copied to your clipboardstatic func extensionVersion() -> String
Example
Copied to your clipboardlet identityVersion = ACPIdentity.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *identityVersion = [ACPIdentity extensionVersion];
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.extensionVersion(function (handleCallback) {console.log("AdobeExperienceSDK: ACPIdentity version: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: failed to get extension version : " + handleError)});
Swift
Syntax
Copied to your clipboardstatic func extensionVersion() -> String
Example
Copied to your clipboardlet identityVersion = ACPIdentity.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *identityVersion = [ACPIdentity extensionVersion];
JavaScript
Copied to your clipboardACPIdentity.extensionVersion().then(identityExtensionVersion => console.log("AdobeExperienceSDK: ACPIdentity version: " + identityExtensionVersion));
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.extensionVersion(function (handleCallback) {console.log("AdobeExperienceSDK: ACPIdentity version: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: failed to get extension version : " + handleError)});
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.
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
Copied to your clipboardpublic static void getExperienceCloudId(final AdobeCallback<String> callback);
- callback is invoked after the ECID is available.
Example
Copied to your clipboardIdentity.getExperienceCloudId(new AdobeCallback<String>() {@Overridepublic void call(String id) {//Handle the ID returned here}});
Method getExperienceCloudIdWithCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func getExperienceCloudId(_ callback: @escaping (String?) -> Void)static func getExperienceCloudId(completionHandler: @escaping (String?, Error?) -> Void)
- 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.
Example
Copied to your clipboardACPIdentity.getExperienceCloudId { (retrievedCloudId) in// handle the retrieved ID here}ACPIdentity.getExperienceCloudId { (retrievedCloudId, error) inif let error = error {// handle error here} else {// handle the retrieved ID here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getExperienceCloudId: (nonnull void (^) (NSString* __nullable experienceCloudId)) callback;+ (void) getExperienceCloudIdWithCompletionHandler: (nonnull void (^) (NSString* __nullable experienceCloudId, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[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}}];
Cordova
Syntax
Copied to your clipboardACPIdentity.getExperienceCloudId(success, fail);
- 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
Copied to your clipboardACPIdentity.getExperienceCloudId(function (handleCallback) {console.log("AdobeExperienceSDK: experienceCloudId: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve experienceCloudId : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetExperienceCloudId(AdobeGetExperienceCloudIdCallback callback)
- callback is a callback containing the ECID if the
GetExperienceCloudId
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetExperienceCloudIdCallback))]public static void HandleAdobeGetExperienceCloudIdCallback(string cloudId){print("ECID is : " + cloudId);}ACPIdentity.GetExperienceCloudId(HandleAdobeGetExperienceCloudIdCallback);
C#
iOS syntax
Copied to your clipboardpublic unsafe static void GetExperienceCloudId (Action<NSString> callback);
- callback is a callback containing the ECID if the
getExperienceCloudId
API executed without any errors.
Android syntax
Copied to your clipboardpublic unsafe static void GetExperienceCloudId (IAdobeCallback callback);
- callback is a callback containing the ECID if the
getExperienceCloudId
API executed without any errors.
iOS example
Copied to your clipboardACPIdentity.GetExperienceCloudId(callback => {Console.WriteLine("Experience Cloud Id: " + callback);});
Android example
Copied to your clipboardACPIdentity.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");}}}
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
Copied to your clipboardpublic static void getExperienceCloudId(final AdobeCallback<String> callback);
- callback is invoked after the ECID is available.
Example
Copied to your clipboardIdentity.getExperienceCloudId(new AdobeCallback<String>() {@Overridepublic void call(String id) {//Handle the ID returned here}});
Method getExperienceCloudIdWithCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func getExperienceCloudId(_ callback: @escaping (String?) -> Void)static func getExperienceCloudId(completionHandler: @escaping (String?, Error?) -> Void)
- 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.
Example
Copied to your clipboardACPIdentity.getExperienceCloudId { (retrievedCloudId) in// handle the retrieved ID here}ACPIdentity.getExperienceCloudId { (retrievedCloudId, error) inif let error = error {// handle error here} else {// handle the retrieved ID here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getExperienceCloudId: (nonnull void (^) (NSString* __nullable experienceCloudId)) callback;+ (void) getExperienceCloudIdWithCompletionHandler: (nonnull void (^) (NSString* __nullable experienceCloudId, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[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}}];
JavaScript
Syntax
Copied to your clipboardgetExperienceCloudId(): Promise<?string>;
Example
Copied to your clipboardACPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
Dart
Syntax
Copied to your clipboardFuture<String> experienceCloudId;
Example
Copied to your clipboardString result = "";try {result = await FlutterACPIdentity.experienceCloudId;} on PlatformException {log("Failed to get experienceCloudId");}
Cordova
Syntax
Copied to your clipboardACPIdentity.getExperienceCloudId(success, fail);
- 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
Copied to your clipboardACPIdentity.getExperienceCloudId(function (handleCallback) {console.log("AdobeExperienceSDK: experienceCloudId: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve experienceCloudId : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetExperienceCloudId(AdobeGetExperienceCloudIdCallback callback)
- callback is a callback containing the ECID if the
GetExperienceCloudId
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetExperienceCloudIdCallback))]public static void HandleAdobeGetExperienceCloudIdCallback(string cloudId){print("ECID is : " + cloudId);}ACPIdentity.GetExperienceCloudId(HandleAdobeGetExperienceCloudIdCallback);
C#
iOS syntax
Copied to your clipboardpublic unsafe static void GetExperienceCloudId (Action<NSString> callback);
- callback is a callback containing the ECID if the
getExperienceCloudId
API executed without any errors.
Android syntax
Copied to your clipboardpublic unsafe static void GetExperienceCloudId (IAdobeCallback callback);
- callback is a callback containing the ECID if the
getExperienceCloudId
API executed without any errors.
iOS example
Copied to your clipboardACPIdentity.GetExperienceCloudId(callback => {Console.WriteLine("Experience Cloud Id: " + callback);});
Android example
Copied to your clipboardACPIdentity.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
This API returns all customer identifiers that were previously synced with the Adobe Experience Cloud Identity Service.
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
Copied to your clipboardpublic static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
- callback is invoked after the customer identifiers are available.
Example
Copied to your clipboardIdentity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {@Overridepublic void call(List<VisitorID> idList) {//Process the IDs here}});
Method getIdentifiersWithCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func getIdentifiers(_ callback: @escaping ([ACPMobileVisitorId]?) -> Void)static func getIdentifiersWithCompletionHandler(_ completionHandler: @escaping ([ACPMobileVisitorId]?, Error?) -> Void)
- 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
Copied to your clipboardACPIdentity.getIdentifiers { (retrievedVisitorIds) in// handle the retrieved identifiers here}ACPIdentity.getIdentifiersWithCompletionHandler { (retrievedVisitorIds, error) inif let error = error {// handle error here} else {// handle the retrieved identifiers here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getIdentifiers: (nonnull void (^) (NSArray<ADBMobileVisitorId*>* __nullable visitorIDs)) callback;+ (void) getIdentifiersWithCompletionHandler: (nonnull void (^) (NSArray<ACPMobileVisitorId*>* __nullable visitorIDs, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[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}}];
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.getIdentifiers(function (handleCallback) {console.log("AdobeExperienceSDK: Visitor identifiers: " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve visitor identifiers : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetIdentifiers(AdobeGetIdentifiersCallback callback)
- callback is a callback containing the previously synced identifiers if the
GetIdentifiers
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetIdentifiersCallback))]public static void HandleAdobeGetIdentifiersCallback(string visitorIds){print("Ids is : " + visitorIds);}ACPIdentity.GetIdentifiers(HandleAdobeGetIdentifiersCallback);
C#
iOS syntax
Copied to your clipboardpublic 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
Copied to your clipboardpublic 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
Copied to your clipboardAction<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
Copied to your clipboardACPIdentity.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);}}
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
Copied to your clipboardpublic static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
- callback is invoked after the customer identifiers are available.
Example
Copied to your clipboardIdentity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {@Overridepublic void call(List<VisitorID> idList) {//Process the IDs here}});
Method getIdentifiersWithCompletionHandler
was added in ACPCore version 2.5.0 and ACPIdentity version 2.2.0.
Swift
Syntax
Copied to your clipboardstatic func getIdentifiers(_ callback: @escaping ([ACPMobileVisitorId]?) -> Void)static func getIdentifiersWithCompletionHandler(_ completionHandler: @escaping ([ACPMobileVisitorId]?, Error?) -> Void)
- 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
Copied to your clipboardACPIdentity.getIdentifiers { (retrievedVisitorIds) in// handle the retrieved identifiers here}ACPIdentity.getIdentifiersWithCompletionHandler { (retrievedVisitorIds, error) inif let error = error {// handle error here} else {// handle the retrieved identifiers here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getIdentifiers: (nonnull void (^) (NSArray<ADBMobileVisitorId*>* __nullable visitorIDs)) callback;+ (void) getIdentifiersWithCompletionHandler: (nonnull void (^) (NSArray<ACPMobileVisitorId*>* __nullable visitorIDs, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[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}}];
JavaScript
Syntax
Copied to your clipboardgetIdentifiers(): Promise<Array<?ACPVisitorID>>;
Example
Copied to your clipboardACPIdentity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));
Dart
Syntax
Copied to your clipboardFuture<List<ACPMobileVisitorId>> identifiers;
Example
Copied to your clipboardList<ACPMobileVisitorId> result;try {result = await FlutterACPIdentity.identifiers;} on PlatformException {log("Failed to get identifiers");}
Cordova
Syntax
Copied to your clipboardACPIdentity.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
Copied to your clipboardACPIdentity.getIdentifiers(function (handleCallback) {console.log("AdobeExperienceSDK: Visitor identifiers: " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve visitor identifiers : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetIdentifiers(AdobeGetIdentifiersCallback callback)
- callback is a callback containing the previously synced identifiers if the
GetIdentifiers
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetIdentifiersCallback))]public static void HandleAdobeGetIdentifiersCallback(string visitorIds){print("Ids is : " + visitorIds);}ACPIdentity.GetIdentifiers(HandleAdobeGetIdentifiersCallback);
C#
iOS syntax
Copied to your clipboardpublic 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
Copied to your clipboardpublic 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
Copied to your clipboardAction<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
Copied to your clipboardACPIdentity.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
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 IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- 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.
Java
This method was added in Core version 1.4.0 and Identity version 1.1.0.
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
Copied to your clipboardpublic static void getUrlVariables(final AdobeCallback<String> callback);
- callback has an NSString value that contains the visitor identifiers as a query string after the service request is complete.
Example
Copied to your clipboardIdentity.getUrlVariables(new AdobeCallback<String>() {@Overridepublic 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);}});
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.
Swift
Syntax
Copied to your clipboardstatic func getUrlVariables(_ callback: @escaping (String?) -> Void)static func getUrlVariables(completionHandler: @escaping (String?, Error?) -> Void)
- callback has an NSString value that contains the visitor identifiers as a query string 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 of 500ms.
Example
Copied to your clipboardACPIdentity.getUrlVariables {(urlVariables) invar 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 URLreturn}// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: urlWithVisitorData))}}ACPIdentity.getUrlVariables { (urlVariables, error) inif 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 URLreturn}// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: urlWithVisitorData))}}}
Objective-C
Syntax
Copied to your clipboard+ (void) getUrlVariables: (nonnull void (^) (NSString* __nullable urlVariables)) callback;+ (void) getUrlVariablesWithCompletionHandler: (nonnull void (^) (NSString* __nullable urlVariables, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPIdentity getUrlVariables:^(NSString * _Nullable urlVariables) {// handle the URL query parameter string hereNSString* 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 threaddispatch_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 hereNSString* 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 threaddispatch_async(dispatch_get_main_queue(), ^{[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];}}}];
Cordova
Syntax
Copied to your clipboardACPIdentity.getUrlVariables(success, fail);
- success is a callback containing the url variables 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
Copied to your clipboardACPIdentity.getUrlVariables(function (handleCallback) {console.log("AdobeExperienceSDK: Url variables: " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve url variables : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetUrlVariables(AdobeGetUrlVariables callback)
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetUrlVariables))]public static void HandleAdobeGetUrlVariables(string urlVariables){print("Url variables are : " + urlVariables);}ACPIdentity.GetUrlVariables(HandleAdobeGetUrlVariables);
C#
iOS syntax
Copied to your clipboardpublic unsafe static void GetUrlVariables (Action<NSString> callback);
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
Android syntax
Copied to your clipboardpublic unsafe static void GetUrlVariables (IAdobeCallback callback);
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
iOS example
Copied to your clipboardACPIdentity.GetUrlVariables(callback => {Console.WriteLine("Url variables: " + callback);});
Android example
Copied to your clipboardACPIdentity.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");}}}
Java
This method was added in Core version 1.4.0 and Identity version 1.1.0.
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
Copied to your clipboardpublic static void getUrlVariables(final AdobeCallback<String> callback);
- callback has an NSString value that contains the visitor identifiers as a query string after the service request is complete.
Example
Copied to your clipboardIdentity.getUrlVariables(new AdobeCallback<String>() {@Overridepublic 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);}});
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.
Swift
Syntax
Copied to your clipboardstatic func getUrlVariables(_ callback: @escaping (String?) -> Void)static func getUrlVariables(completionHandler: @escaping (String?, Error?) -> Void)
- callback has an NSString value that contains the visitor identifiers as a query string 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 of 500ms.
Example
Copied to your clipboardACPIdentity.getUrlVariables {(urlVariables) invar 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 URLreturn}// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: urlWithVisitorData))}}ACPIdentity.getUrlVariables { (urlVariables, error) inif 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 URLreturn}// APIs which update the UI must be called from main threadDispatchQueue.main.async {self.webView.load(URLRequest(url: urlWithVisitorData))}}}
Objective-C
Syntax
Copied to your clipboard+ (void) getUrlVariables: (nonnull void (^) (NSString* __nullable urlVariables)) callback;+ (void) getUrlVariablesWithCompletionHandler: (nonnull void (^) (NSString* __nullable urlVariables, NSError* __nullable error)) completionHandler;
Example
Copied to your clipboard[ACPIdentity getUrlVariables:^(NSString * _Nullable urlVariables) {// handle the URL query parameter string hereNSString* 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 threaddispatch_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 hereNSString* 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 threaddispatch_async(dispatch_get_main_queue(), ^{[[self webView] loadRequest:[NSURLRequest requestWithURL:urlWithVisitorData]];}}}];
This method was added in react-native-acpcore v1.0.5.
JavaScript
Syntax
Copied to your clipboardgetUrlVariables(): Promise<?string>;
Example
Copied to your clipboardACPIdentity.getUrlVariables().then(urlVariables => console.log("AdobeExperenceSDK: query params = " + urlVariables));
Dart
Syntax
Copied to your clipboardFuture<String> urlVariables;
Example
Copied to your clipboardString result = "";try {result = await FlutterACPIdentity.urlVariables;} on PlatformException {log("Failed to get url variables");}
Cordova
Syntax
Copied to your clipboardACPIdentity.getUrlVariables(success, fail);
- success is a callback containing the url variables 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
Copied to your clipboardACPIdentity.getUrlVariables(function (handleCallback) {console.log("AdobeExperienceSDK: Url variables: " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to retrieve url variables : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void GetUrlVariables(AdobeGetUrlVariables callback)
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
Example
Copied to your clipboard[MonoPInvokeCallback(typeof(AdobeGetUrlVariables))]public static void HandleAdobeGetUrlVariables(string urlVariables){print("Url variables are : " + urlVariables);}ACPIdentity.GetUrlVariables(HandleAdobeGetUrlVariables);
C#
iOS syntax
Copied to your clipboardpublic unsafe static void GetUrlVariables (Action<NSString> callback);
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
Android syntax
Copied to your clipboardpublic unsafe static void GetUrlVariables (IAdobeCallback callback);
- callback is a callback containing the url variables in query parameter form if the
GetUrlVariables
API executed without any errors.
iOS example
Copied to your clipboardACPIdentity.GetUrlVariables(callback => {Console.WriteLine("Url variables: " + callback);});
Android example
Copied to your clipboardACPIdentity.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.
Java
After calling the setApplication()
method in the onCreate()
method, register the extension. If the registration was not successful, an InvalidInitException
is thrown.
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);try {Identity.registerExtension();} catch (Exception e) {//Log the exception}}}
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
Example
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPIdentity.registerExtension()// Override point for customization after application launch.return true;}
Objective-C
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPIdentity registerExtension];// Override point for customization after application launch.return YES;}
C#
iOS
Register the Identity extension in your app's FinishedLaunching()
function:
Copied to your clipboardpublic override bool FinishedLaunching(UIApplication app, NSDictionary options){global::Xamarin.Forms.Forms.Init();LoadApplication(new App());ACPIdentity.RegisterExtension();// start coreACPCore.Start(startCallback);return base.FinishedLaunching(app, options);}
Android
Register the Identity extension in your app's OnCreate()
function:
Copied to your clipboardprotected override void OnCreate(Bundle savedInstanceState){base.OnCreate(savedInstanceState);global::Xamarin.Forms.Forms.Init(this, savedInstanceState);LoadApplication(new App());ACPIdentity.RegisterExtension();// start coreACPCore.Start(new CoreStartCompletionCallback());}
Java
After calling the setApplication()
method in the onCreate()
method, register the extension. If the registration was not successful, an InvalidInitException
is thrown.
Copied to your clipboardpublic class MobileApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);try {Identity.registerExtension();} catch (Exception e) {//Log the exception}}}
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
Example
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPIdentity.registerExtension()// Override point for customization after application launch.return true;}
Objective-C
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPIdentity registerExtension];// Override point for customization after application launch.return YES;}
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.
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
When using Cordova, registering Identity with Mobile Core should be done in native code which is shown under the Android and iOS tabs.
C#
Register the Identity extension in your app's Start()
function:
Copied to your clipboardvoid Start() {ACPIdentity.RegisterExtension();}
C#
iOS
Register the Identity extension in your app's FinishedLaunching()
function:
Copied to your clipboardpublic override bool FinishedLaunching(UIApplication app, NSDictionary options){global::Xamarin.Forms.Forms.Init();LoadApplication(new App());ACPIdentity.RegisterExtension();// start coreACPCore.Start(startCallback);return base.FinishedLaunching(app, options);}
Android
Register the Identity extension in your app's OnCreate()
function:
Copied to your clipboardprotected override void OnCreate(Bundle savedInstanceState){base.OnCreate(savedInstanceState);global::Xamarin.Forms.Forms.Init(this, savedInstanceState);LoadApplication(new App());ACPIdentity.RegisterExtension();// start coreACPCore.Start(new CoreStartCompletionCallback());}
setAdvertisingIdentifier
The advertising ID is preserved between app upgrades, is saved and restored during the standard application backup process, available via the Signals extension, and is removed at uninstall.
If the current SDK privacy status is optedout
, the advertising identifier is not set or stored.
Java
Syntax
Copied to your clipboardpublic 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 AdvertisingIdClient.
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 Google Mobile Ads SDK setup.
Copied to your clipboard...@Overridepublic void onResume() {super.onResume();...new Thread(new Runnable() {@Overridepublic void run() {String advertisingIdentifier = null;try {AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());if (adInfo != null) {if (!adInfo.isLimitAdTrackingEnabled()) {advertisingIdentifier = adInfo.getId();} else {MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "Limit Ad Tracking is enabled by the user, cannot process the advertising identifier");}}} catch (IOException e) {// Unrecoverable error connecting to Google Play services (e.g.,// the old version of the service doesn't support getting AdvertisingId).MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "IOException while retrieving the advertising identifier " + e.getLocalizedMessage());} catch (GooglePlayServicesNotAvailableException e) {// Google Play services is not available entirely.MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "GooglePlayServicesNotAvailableException while retrieving the advertising identifier " + e.getLocalizedMessage());} catch (GooglePlayServicesRepairableException e) {// Google Play services is not installed, up-to-date, or enabled.MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "GooglePlayServicesRepairableException while retrieving the advertising identifier " + e.getLocalizedMessage());}MobileCore.setAdvertisingIdentifier(advertisingIdentifier);}}).start();}
To access IDFA and handle it correctly in your mobile application, see Apple developer documentation about IDFA
Starting iOS 14+, applications must use the App Tracking Transparency framework to request user authorization before using the Identifier for Advertising (IDFA).
Swift
Syntax
Copied to your clipboardstatic func setAdvertisingIdentifier(adId: String?)
- adId is a string that provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardimport AdSupportimport AppTrackingTransparency...func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {...if #available(iOS 14, *) {setAdvertisingIdentiferUsingTrackingManager()} else {// Fallback on earlier versionssetAdvertisingIdentifierUsingIdentifierManager()}}func setAdvertisingIdentifierUsingIdentifierManager() {var idfa:String = "";if (ASIdentifierManager.shared().isAdvertisingTrackingEnabled) {idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString;} else {ACPCore.log(ACPMobileLogLevel.debug,tag: "AppDelegateExample",message: "Advertising Tracking is disabled by the user, cannot process the advertising identifier.");}ACPCore.setAdvertisingIdentifier(idfa);}@available(iOS 14, *)func setAdvertisingIdentiferUsingTrackingManager() {ATTrackingManager.requestTrackingAuthorization { (status) invar idfa: String = "";switch (status) {case .authorized:idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidStringcase .denied:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is denied by the user, cannot process the advertising identifier.")case .notDetermined:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is not determined, cannot process the advertising identifier.")case .restricted:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is restricted by the user, cannot process the advertising identifier.")}ACPCore.setAdvertisingIdentifier(idfa)}}
Objective-C
Syntax
Copied to your clipboard+ (void) setAdvertisingIdentifier: (nullable NSString*) adId;
Example
Copied to your clipboard#import <AdSupport/ASIdentifierManager.h>#import <AppTrackingTransparency/ATTrackingManager.h>...- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {- ...-if (@available(iOS 14, *)) {[self setAdvertisingIdentiferUsingTrackingManager];} else {// fallback to earlier versions[self setAdvertisingIdentifierUsingIdentifierManager];}}- (void) setAdvertisingIdentifierUsingIdentifierManager {// setup the advertising identifierNSString *idfa = nil;if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];} else {[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is disabled by the user, cannot process the advertising identifier"];}[ACPCore setAdvertisingIdentifier:idfa];}- (void) setAdvertisingIdentiferUsingTrackingManager API_AVAILABLE(ios(14)) {[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status){NSString *idfa = nil;switch(status) {case ATTrackingManagerAuthorizationStatusAuthorized:idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];break;case ATTrackingManagerAuthorizationStatusDenied:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is denied by the user, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusNotDetermined:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is not determined, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusRestricted:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is restricted by the user, cannot process the advertising identifier"];break;}[ACPCore setAdvertisingIdentifier:idfa];}];}
Cordova
Syntax
Copied to your clipboardACPCore.setAdvertisingIdentifier(identifier, success, fail);
- identifier (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
- success is a callback containing a general success message if the
setAdvertisingIdentifier
API executed without any errors. - fail is a callback containing error information if the
setAdvertisingIdentifier
API was executed with errors.
Example
Copied to your clipboardACPCore.setAdvertisingIdentifier("ADVTID", function (handleCallback) {console.log("AdobeExperienceSDK: Advertising identifier successfully set.");}, function (handleError) {console.log("AdobeExperenceSDK: Failed to set advertising identifier : " + handleError);});
C#
iOS syntax
Copied to your clipboardpublic static void SetAdvertisingIdentifier (string adId);
- adId (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
Android syntax
Copied to your clipboardpublic unsafe static void SetAdvertisingIdentifier (string advertisingIdentifier);
- advertisingIdentifier (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardACPCore.SetAdvertisingIdentifier("ADVTID");
Java
Syntax
Copied to your clipboardpublic 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 AdvertisingIdClient.
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 Google Mobile Ads SDK setup.
Copied to your clipboard...@Overridepublic void onResume() {super.onResume();...new Thread(new Runnable() {@Overridepublic void run() {String advertisingIdentifier = null;try {AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());if (adInfo != null) {if (!adInfo.isLimitAdTrackingEnabled()) {advertisingIdentifier = adInfo.getId();} else {MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "Limit Ad Tracking is enabled by the user, cannot process the advertising identifier");}}} catch (IOException e) {// Unrecoverable error connecting to Google Play services (e.g.,// the old version of the service doesn't support getting AdvertisingId).MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "IOException while retrieving the advertising identifier " + e.getLocalizedMessage());} catch (GooglePlayServicesNotAvailableException e) {// Google Play services is not available entirely.MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "GooglePlayServicesNotAvailableException while retrieving the advertising identifier " + e.getLocalizedMessage());} catch (GooglePlayServicesRepairableException e) {// Google Play services is not installed, up-to-date, or enabled.MobileCore.log(LoggingMode.DEBUG, "ExampleActivity", "GooglePlayServicesRepairableException while retrieving the advertising identifier " + e.getLocalizedMessage());}MobileCore.setAdvertisingIdentifier(advertisingIdentifier);}}).start();}
To access IDFA and handle it correctly in your mobile application, see Apple developer documentation about IDFA
Starting iOS 14+, applications must use the App Tracking Transparency framework to request user authorization before using the Identifier for Advertising (IDFA).
Swift
Syntax
Copied to your clipboardstatic func setAdvertisingIdentifier(adId: String?)
- adId is a string that provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardimport AdSupportimport AppTrackingTransparency...func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {...if #available(iOS 14, *) {setAdvertisingIdentiferUsingTrackingManager()} else {// Fallback on earlier versionssetAdvertisingIdentifierUsingIdentifierManager()}}func setAdvertisingIdentifierUsingIdentifierManager() {var idfa:String = "";if (ASIdentifierManager.shared().isAdvertisingTrackingEnabled) {idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString;} else {ACPCore.log(ACPMobileLogLevel.debug,tag: "AppDelegateExample",message: "Advertising Tracking is disabled by the user, cannot process the advertising identifier.");}ACPCore.setAdvertisingIdentifier(idfa);}@available(iOS 14, *)func setAdvertisingIdentiferUsingTrackingManager() {ATTrackingManager.requestTrackingAuthorization { (status) invar idfa: String = "";switch (status) {case .authorized:idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidStringcase .denied:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is denied by the user, cannot process the advertising identifier.")case .notDetermined:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is not determined, cannot process the advertising identifier.")case .restricted:ACPCore.log(.debug,tag: "AppDelegateExample",message: "Advertising Tracking is restricted by the user, cannot process the advertising identifier.")}ACPCore.setAdvertisingIdentifier(idfa)}}
Objective-C
Syntax
Copied to your clipboard+ (void) setAdvertisingIdentifier: (nullable NSString*) adId;
Example
Copied to your clipboard#import <AdSupport/ASIdentifierManager.h>#import <AppTrackingTransparency/ATTrackingManager.h>...- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {- ...-if (@available(iOS 14, *)) {[self setAdvertisingIdentiferUsingTrackingManager];} else {// fallback to earlier versions[self setAdvertisingIdentifierUsingIdentifierManager];}}- (void) setAdvertisingIdentifierUsingIdentifierManager {// setup the advertising identifierNSString *idfa = nil;if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];} else {[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is disabled by the user, cannot process the advertising identifier"];}[ACPCore setAdvertisingIdentifier:idfa];}- (void) setAdvertisingIdentiferUsingTrackingManager API_AVAILABLE(ios(14)) {[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status){NSString *idfa = nil;switch(status) {case ATTrackingManagerAuthorizationStatusAuthorized:idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];break;case ATTrackingManagerAuthorizationStatusDenied:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is denied by the user, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusNotDetermined:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is not determined, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusRestricted:[ACPCore log:ACPMobileLogLevelDebugtag:@"AppDelegateExample"message:@"Advertising Tracking is restricted by the user, cannot process the advertising identifier"];break;}[ACPCore setAdvertisingIdentifier:idfa];}];}
JavaScript
Syntax
Copied to your clipboardsetAdvertisingIdentifier(advertisingIdentifier?: String);
- adID is a string that provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardACPCore.setAdvertisingIdentifier("ADVTID");
Dart
Syntax
Copied to your clipboardFuture<void> setAdvertisingIdentifier (String aid);
- aid is a string that provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardFlutterACPCore.setAdvertisingIdentifier("ADVTID");
Cordova
Syntax
Copied to your clipboardACPCore.setAdvertisingIdentifier(identifier, success, fail);
- identifier (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
- success is a callback containing a general success message if the
setAdvertisingIdentifier
API executed without any errors. - fail is a callback containing error information if the
setAdvertisingIdentifier
API was executed with errors.
Example
Copied to your clipboardACPCore.setAdvertisingIdentifier("ADVTID", function (handleCallback) {console.log("AdobeExperienceSDK: Advertising identifier successfully set.");}, function (handleError) {console.log("AdobeExperenceSDK: Failed to set advertising identifier : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void SetAdvertisingIdentifier(string adId)
- adId (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardACPCore.SetAdvertisingIdentifier("ADVTID");
C#
iOS syntax
Copied to your clipboardpublic static void SetAdvertisingIdentifier (string adId);
- adId (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
Android syntax
Copied to your clipboardpublic unsafe static void SetAdvertisingIdentifier (string advertisingIdentifier);
- advertisingIdentifier (String) provides developers with a simple, standard system to continue to track the Ads through their apps.
Example
Copied to your clipboardACPCore.SetAdvertisingIdentifier("ADVTID");
setPushIdentifier
This API sets the device token for push notifications in the SDK. If the current SDK privacy status is optedout
, the push identifier is not set.
You should call setPushIdentifier
on each application launch to ensure the most up-to-date device token is set to the SDK. If no device token is available, null
/nil
should be passed.
Java
Syntax
Copied to your clipboardpublic static void setPushIdentifier(final String pushIdentifier);
- pushIdentifier is a string that contains the device token for push notifications.
Example
Copied to your clipboard//Retrieve the token from either GCM or FCM, and pass it to the SDKMobileCore.setPushIdentifier(token);
Swift
Syntax
Copied to your clipboardstatic func setPushIdentifier(deviceToken: NSData?)
- deviceToken is a string that contains the device token for push notifications.
Example
Copied to your clipboard// Set the deviceToken that the APNs has assigned to the deviceACPCore.setPushIdentifier(deviceToken)
Objective-C
Syntax
Copied to your clipboard+ (void) setPushIdentifier: (nullable NSData*) deviceToken;
Example
Copied to your clipboard// Set the deviceToken that the APNS has assigned to the device[ACPCore setPushIdentifier:deviceToken];
Java
Syntax
Copied to your clipboardpublic static void setPushIdentifier(final String pushIdentifier);
- pushIdentifier is a string that contains the device token for push notifications.
Example
Copied to your clipboard//Retrieve the token from either GCM or FCM, and pass it to the SDKMobileCore.setPushIdentifier(token);
Swift
Syntax
Copied to your clipboardstatic func setPushIdentifier(deviceToken: NSData?)
- deviceToken is a string that contains the device token for push notifications.
Example
Copied to your clipboard// Set the deviceToken that the APNs has assigned to the deviceACPCore.setPushIdentifier(deviceToken)
Objective-C
Syntax
Copied to your clipboard+ (void) setPushIdentifier: (nullable NSData*) deviceToken;
Example
Copied to your clipboard// Set the deviceToken that the APNS has assigned to the device[ACPCore setPushIdentifier:deviceToken];
syncIdentifier
The syncIdentifier()
and syncIdentifiers()
APIs update the specified customer IDs with the Adobe Experience Cloud Identity Service.
These APIs synchronize the provided customer identifier type key and value with the authentication state to the Experience Cloud Identity Service. If the specified customer ID type exists in the service, this ID type is updated with the new ID and the authentication state. Otherwise, a new customer ID is added.
Starting with ACPIdentity v2.1.3 (iOS) and Identity v1.1.2 (Android) if the new identifier
value is null or empty, this ID type is removed from the local storage, Identity shared state and not synced with the Experience Cloud Identity Service.
These IDs are preserved between app upgrades, are saved and restored during the standard application backup process, and are removed at uninstall.
If the current SDK privacy status is MobilePrivacyStatus.OPT_OUT
, calling this method results in no operations being performed.
This API updates or appends the provided customer identifier type key and value with the given authentication state to the Experience Cloud Identity Service. If the specified customer ID type exists in the service, the ID is updated with the new ID and authentication state. Otherwise a new customer ID is added.
Java
Syntax
Copied to your clipboardpublic static void syncIdentifier(final String identifierType,final String identifier,final VisitorID.AuthenticationState authenticationState);
- identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - identifier (String) contains the
identifier value
, and this parameter should not be null or empty. - authenticationState (AuthenticationState) indicates the authentication state of the user and contains one of the VisitorID.AuthenticationState values.
Example
Copied to your clipboardIdentity.syncIdentifier("idType","idValue",VisitorID.AuthenticationState.AUTHENTICATED);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifier(_ identifierType: String, identifier: String, authentication authenticationState: ACPMobileVisitorAuthenticationState)
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - The authenticationState (ACPMobileVisitorAuthenticationState) value indicates the authentication state for the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardACPIdentity.syncIdentifier("idType", identifier: "idValue", authentication: ACPMobileVisitorAuthenticationState.unknown)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifier: (nonnull NSString*) identifierTypeidentifier: (nonnull NSString*) identifierauthentication: (ADBMobileVisitorAuthenticationState) authenticationState;
Example
Copied to your clipboard[ACPIdentity syncIdentifier:@"idType" identifier:@"idValue" authentication:ACPMobileVisitorAuthenticationStateUnknown];
JavaScript
Syntax
Copied to your clipboardsyncIdentifier(identifierType: String, identifier: String, authenticationState: string);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (ACPMobileVisitorAuthenticationState) value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';ACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifier(String identifierType, String identifier, ACPMobileVisitorAuthenticationState authState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPMobileVisitorAuthenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';FlutterACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifier = function(identifierType, identifier, authState, success, fail);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPMobileVisitorAuthenticationState) value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
- success is a callback containing the visitor id type, value, and authentication state if the
syncIdentifier
API executed without any errors. - fail is a callback containing error information if the
syncIdentifier
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifier("id1", "value1", ACPIdentity.ACPMobileVisitorAuthenticationStateUnknown, function (handleCallback) {console.log("AdobeExperenceSDK: Identifier synced successfully : " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifier : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifier(string identifierType, string identifier, ACPAuthenticationState authState)
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPAuthenticationState) value indicating authentication state for the user and contains one of the following ACPAuthenticationState values.
Example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", ACPIdentity.ACPAuthenticationState.AUTHENTICATED);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifier (string identifierType, string identifier, ACPMobileVisitorAuthenticationState authenticationState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (ACPMobileVisitorAuthenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifier (string identifierType, string identifier, VisitorID.AuthenticationState authenticationState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (AuthenticationState) value indicating authentication state for the user and contains one of the following VisitorID.AuthenticationState values.
iOS example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", ACPMobileVisitorAuthenticationState.Authenticated);
Android example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", VisitorID.AuthenticationState.Authenticated);
Java
Syntax
Copied to your clipboardpublic static void syncIdentifier(final String identifierType,final String identifier,final VisitorID.AuthenticationState authenticationState);
- identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - identifier (String) contains the
identifier value
, and this parameter should not be null or empty. - authenticationState (AuthenticationState) indicates the authentication state of the user and contains one of the VisitorID.AuthenticationState values.
Example
Copied to your clipboardIdentity.syncIdentifier("idType","idValue",VisitorID.AuthenticationState.AUTHENTICATED);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifier(_ identifierType: String, identifier: String, authentication authenticationState: ACPMobileVisitorAuthenticationState)
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - The authenticationState (ACPMobileVisitorAuthenticationState) value indicates the authentication state for the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardACPIdentity.syncIdentifier("idType", identifier: "idValue", authentication: ACPMobileVisitorAuthenticationState.unknown)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifier: (nonnull NSString*) identifierTypeidentifier: (nonnull NSString*) identifierauthentication: (ADBMobileVisitorAuthenticationState) authenticationState;
Example
Copied to your clipboard[ACPIdentity syncIdentifier:@"idType" identifier:@"idValue" authentication:ACPMobileVisitorAuthenticationStateUnknown];
JavaScript
Syntax
Copied to your clipboardsyncIdentifier(identifierType: String, identifier: String, authenticationState: string);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (ACPMobileVisitorAuthenticationState) value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';ACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifier(String identifierType, String identifier, ACPMobileVisitorAuthenticationState authState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPMobileVisitorAuthenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';FlutterACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifier = function(identifierType, identifier, authState, success, fail);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPMobileVisitorAuthenticationState) value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
- success is a callback containing the visitor id type, value, and authentication state if the
syncIdentifier
API executed without any errors. - fail is a callback containing error information if the
syncIdentifier
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifier("id1", "value1", ACPIdentity.ACPMobileVisitorAuthenticationStateUnknown, function (handleCallback) {console.log("AdobeExperenceSDK: Identifier synced successfully : " + handleCallback);}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifier : " + handleError);});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifier(string identifierType, string identifier, ACPAuthenticationState authState)
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authState (ACPAuthenticationState) value indicating authentication state for the user and contains one of the following ACPAuthenticationState values.
Example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", ACPIdentity.ACPAuthenticationState.AUTHENTICATED);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifier (string identifierType, string identifier, ACPMobileVisitorAuthenticationState authenticationState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (ACPMobileVisitorAuthenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifier (string identifierType, string identifier, VisitorID.AuthenticationState authenticationState);
- The identifierType (String) contains the
identifier type
, and this parameter should not be null or empty. The allowed characters are [A-Za-z0-9_.] - The identifier (String) contains the
identifier
value, and this parameter should not be null or empty. If either theidentifier type
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - authenticationState (AuthenticationState) value indicating authentication state for the user and contains one of the following VisitorID.AuthenticationState values.
iOS example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", ACPMobileVisitorAuthenticationState.Authenticated);
Android example
Copied to your clipboardACPIdentity.SyncIdentifier("idType1", "idValue1", VisitorID.AuthenticationState.Authenticated);
syncIdentifiers
This API is an overloaded version, which does not include the parameter for the authentication state and it assumes a default value of VisitorID.AuthenticationState.UNKNOWN
.
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(final Map<String, String> identifiers);
- identifiers is a map that contains the identifiers with the Identifier type as the key, and the string identifier as the value. In each identifier pair, if the
identifier type
contains a null or an empty string, the identifier is ignored by the Identity extension.
Example
Copied to your clipboardMap<String, String> identifiers = new HashMap<String, String>();identifiers.put("idType1", "idValue1");identifiers.put("idType2", "idValue2");identifiers.put("idType3", "idValue3");Identity.syncIdentifiers(identifiers);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifiers(_ identifiers: [AnyHashable : Any]?)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardlet identifiers : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];ACPIdentity.syncIdentifiers(identifiers)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers;
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[ACPIdentity syncIdentifiers:ids];
JavaScript
Syntax
Copied to your clipboardsyncIdentifiers(identifiers?: {string: string});
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"id1": "identifier1"});
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifiers (Map<String, String> identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardFlutterACPIdentity.syncIdentifiers({"idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"});
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifiers = function(identifiers, success, fail);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - success is a callback containing the synced identifiers if the
syncIdentifiers
API executed without any errors. - fail is a callback containing error information if the
syncIdentifiers
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, function (handleCallback) {console.log("AdobeExperienceSDK: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifiers : " + handleError)});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifiers(Dictionary<string, string> identifiers)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardDictionary<string, string> ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifiers (NSDictionary identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifiers (IDictionary<string, string> identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
iOS example
Copied to your clipboardvar ids = new NSMutableDictionary<NSString, NSObject>{["idsType1"] = new NSString("idValue1"),["idsType2"] = new NSString("idValue2"),["idsType3"] = new NSString("idValue3")};ACPIdentity.SyncIdentifiers(ids);
Android example
Copied to your clipboardvar ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids);
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(final Map<String, String> identifiers);
- identifiers is a map that contains the identifiers with the Identifier type as the key, and the string identifier as the value. In each identifier pair, if the
identifier type
contains a null or an empty string, the identifier is ignored by the Identity extension.
Example
Copied to your clipboardMap<String, String> identifiers = new HashMap<String, String>();identifiers.put("idType1", "idValue1");identifiers.put("idType2", "idValue2");identifiers.put("idType3", "idValue3");Identity.syncIdentifiers(identifiers);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifiers(_ identifiers: [AnyHashable : Any]?)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardlet identifiers : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];ACPIdentity.syncIdentifiers(identifiers)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers;
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[ACPIdentity syncIdentifiers:ids];
JavaScript
Syntax
Copied to your clipboardsyncIdentifiers(identifiers?: {string: string});
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"id1": "identifier1"});
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifiers (Map<String, String> identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardFlutterACPIdentity.syncIdentifiers({"idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"});
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifiers = function(identifiers, success, fail);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - success is a callback containing the synced identifiers if the
syncIdentifiers
API executed without any errors. - fail is a callback containing error information if the
syncIdentifiers
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, function (handleCallback) {console.log("AdobeExperienceSDK: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifiers : " + handleError)});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifiers(Dictionary<string, string> identifiers)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Example
Copied to your clipboardDictionary<string, string> ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifiers (NSDictionary identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifiers (IDictionary<string, string> identifiers);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored.
iOS example
Copied to your clipboardvar ids = new NSMutableDictionary<NSString, NSObject>{["idsType1"] = new NSString("idValue1"),["idsType2"] = new NSString("idValue2"),["idsType3"] = new NSString("idValue3")};ACPIdentity.SyncIdentifiers(ids);
Android example
Copied to your clipboardvar ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids);
syncIdentifiers (overloaded)
The function of this API is the same as the syncIdentifier
API. This API passes a list of identifiers, and each identifier contains an identifier type
as the key and an identifier
as the value. In each identifier pair, if the identifier type
contains a null or an empty string, the identifier is ignored by the Identity extension.
Starting with ACPIdentity v2.1.3 (iOS) and Identity v1.1.2 (Android) if the new identifier
value is null or empty, this ID type is removed from the local storage, Identity shared state and not synced with the Adobe Experience Cloud Identity Service.
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(final Map<String, String> identifiers, final VisitorID.AuthenticationState authState)
- identifiers is a map that contains IDs with the identifier type as the key, and the string identifier as the value.
- authState indicates the authentication state for the user, which contains one of the following VisitorID.AuthenticationState values.
Example
Copied to your clipboardMap<String, String> identifiers = new HashMap<String, String>();identifiers.put("idType1", "idValue1");identifiers.put("idType2", "idValue2");identifiers.put("idType3", "idValue3");Identity.syncIdentifiers(identifiers, VisitorID.AuthenticationState.AUTHENTICATED);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifiers(_ identifiers: [AnyHashable : Any]?, authentication authenticationState: ACPMobileVisitorAuthenticationState)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authenticationState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];ACPIdentity.syncIdentifiers(identifiers, authentication:ACPMobileVisitorAuthenticationState.authenticated)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers authentication: (ACPMobileVisitorAuthenticationState) authenticationState;
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[ACPIdentity syncIdentifiers:ids authentication:ACPMobileVisitorAuthenticationStateAuthenticated];
JavaScript
Syntax
Copied to your clipboardsyncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authenticationState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';ACPIdentity.syncIdentifiersWithAuthState({"id1": "identifier1"}, ACPMobileVisitorAuthenticationState.UNKNOWN);
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifiersWithAuthState (Map<String, String> identifiers, ACPMobileVisitorAuthenticationState authState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';FlutterACPIdentity.syncIdentifiersWithAuthState({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, ACPMobileVisitorAuthenticationState.UNKNOWN);
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifiers = function(identifiers, authState, success, fail);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authState value indicating authentication state for the identifiers to be synced and contains one of the ACPMobileVisitorAuthenticationState values.
- success is a callback containing the synced identifiers if the
syncIdentifiers
API executed without any errors. - fail is a callback containing error information if the
syncIdentifiers
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, ACPIdentity.ACPMobileVisitorAuthenticationStateAuthenticated, function (handleCallback) {console.log("AdobeExperienceSDK: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifiers : " + handleError)});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifiers(Dictionary<string, string> ids, ACPAuthenticationState authenticationState)
- The ids dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the identifiers to be synced and contains one of the ACPAuthenticationState values.
Example
Copied to your clipboardDictionary<string, string> ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.AUTHENTICATED);ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.LOGGED_OUT);ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.UNKNOWN);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifiers (NSDictionary identifiers, ACPMobileVisitorAuthenticationState authenticationState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifiers (IDictionary<string, string> identifiers, VisitorID.AuthenticationState authenticationState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the user and contains one of the following VisitorID.AuthenticationState values.
iOS example
Copied to your clipboardvar ids = new NSMutableDictionary<NSString, NSObject>{["idsType1"] = new NSString("idValue1"),["idsType2"] = new NSString("idValue2"),["idsType3"] = new NSString("idValue3")};ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut);
Android example
Copied to your clipboardvar ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids, VisitorID.AuthenticationState.LoggedOut);
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(final Map<String, String> identifiers, final VisitorID.AuthenticationState authState)
- identifiers is a map that contains IDs with the identifier type as the key, and the string identifier as the value.
- authState indicates the authentication state for the user, which contains one of the following VisitorID.AuthenticationState values.
Example
Copied to your clipboardMap<String, String> identifiers = new HashMap<String, String>();identifiers.put("idType1", "idValue1");identifiers.put("idType2", "idValue2");identifiers.put("idType3", "idValue3");Identity.syncIdentifiers(identifiers, VisitorID.AuthenticationState.AUTHENTICATED);
Swift
Syntax
Copied to your clipboardstatic func syncIdentifiers(_ identifiers: [AnyHashable : Any]?, authentication authenticationState: ACPMobileVisitorAuthenticationState)
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authenticationState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];ACPIdentity.syncIdentifiers(identifiers, authentication:ACPMobileVisitorAuthenticationState.authenticated)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers authentication: (ACPMobileVisitorAuthenticationState) authenticationState;
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[ACPIdentity syncIdentifiers:ids authentication:ACPMobileVisitorAuthenticationStateAuthenticated];
JavaScript
Syntax
Copied to your clipboardsyncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authenticationState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';ACPIdentity.syncIdentifiersWithAuthState({"id1": "identifier1"}, ACPMobileVisitorAuthenticationState.UNKNOWN);
Dart
Syntax
Copied to your clipboardFuture<void> syncIdentifiersWithAuthState (Map<String, String> identifiers, ACPMobileVisitorAuthenticationState authState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - The authState (ACPMobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the ACPMobileVisitorAuthenticationState values.
Example
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';FlutterACPIdentity.syncIdentifiersWithAuthState({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, ACPMobileVisitorAuthenticationState.UNKNOWN);
Cordova
Syntax
Copied to your clipboardACPIdentity.syncIdentifiers = function(identifiers, authState, success, fail);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authState value indicating authentication state for the identifiers to be synced and contains one of the ACPMobileVisitorAuthenticationState values.
- success is a callback containing the synced identifiers if the
syncIdentifiers
API executed without any errors. - fail is a callback containing error information if the
syncIdentifiers
API was executed with errors.
Example
Copied to your clipboardACPIdentity.syncIdentifiers({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, ACPIdentity.ACPMobileVisitorAuthenticationStateAuthenticated, function (handleCallback) {console.log("AdobeExperienceSDK: " + handleCallback)}, function (handleError) {console.log("AdobeExperenceSDK: Failed to sync identifiers : " + handleError)});
C#
Syntax
Copied to your clipboardpublic static void SyncIdentifiers(Dictionary<string, string> ids, ACPAuthenticationState authenticationState)
- The ids dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the identifiers to be synced and contains one of the ACPAuthenticationState values.
Example
Copied to your clipboardDictionary<string, string> ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.AUTHENTICATED);ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.LOGGED_OUT);ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.UNKNOWN);
C#
iOS syntax
Copied to your clipboardpublic static void SyncIdentifiers (NSDictionary identifiers, ACPMobileVisitorAuthenticationState authenticationState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the user and contains one of the following ACPMobileVisitorAuthenticationState values.
Android syntax
Copied to your clipboardpublic unsafe static void SyncIdentifiers (IDictionary<string, string> identifiers, VisitorID.AuthenticationState authenticationState);
- The identifiers dictionary contains identifiers, and each identifier contains an
identifier type
as the key and anidentifier
as the value. If any of the identifier pairs contains an empty or null value as theidentifier type
, then it will be ignored. - authenticationState value indicating authentication state for the user and contains one of the following VisitorID.AuthenticationState values.
iOS example
Copied to your clipboardvar ids = new NSMutableDictionary<NSString, NSObject>{["idsType1"] = new NSString("idValue1"),["idsType2"] = new NSString("idValue2"),["idsType3"] = new NSString("idValue3")};ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut);
Android example
Copied to your clipboardvar ids = new Dictionary<string, string>();ids.Add("idsType1", "idValue1");ids.Add("idsType2", "idValue2");ids.Add("idsType3", "idValue3");ACPIdentity.SyncIdentifiers(ids, VisitorID.AuthenticationState.LoggedOut);
Public classes
AuthenticationState
This class is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardpublic enum AuthenticationState {UNKNOWN,AUTHENTICATED,LOGGED_OUT;}
VisitorID
This class is an identifier to be used with the Adobe Experience Cloud Identity Service.
Copied to your clipboardpublic class VisitorID {//Constructorpublic VisitorID(String idOrigin, String idType, String id, VisitorID.AuthenticationState authenticationState);public VisitorID.AuthenticationState getAuthenticationState();public final String getId();public final String getIdOrigin();public final String getIdType();}
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardtypedef NS_ENUM(NSUInteger,ACPMobileVisitorAuthenticationState) {ACPMobileVisitorAuthenticationStateUnknown = 0,ACPMobileVisitorAuthenticationStateAuthenticated = 1,ACPMobileVisitorAuthenticationStateLoggedOut = 2 };
ACPMobileVisitorId
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboard@interface ACPMobileVisitorId : NSObject@property(nonatomic, strong, nullable) NSString* idOrigin;@property(nonatomic, strong, nullable) NSString* idType;@property(nonatomic, strong, nullable) NSString* identifier;@property(nonatomic, readwrite) ACPMobileVisitorAuthenticationState authenticationState;@end
JavaScript
ACPVisitorID
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboardimport {ACPVisitorID} from '@adobe/react-native-acpcore';var visitorId = new ACPVisitorID(idOrigin?: string, idType: string, id?: string, authenticationState?: ACPMobileVisitorAuthenticationState);
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';var state = ACPMobileVisitorAuthenticationState.AUTHENTICATED;//var state = ACPMobileVisitorAuthenticationState.LOGGED_OUT;//var state = ACPMobileVisitorAuthenticationState.UNKNOWN;
Dart
ACPVisitorID
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';class ACPMobileVisitorId {String get idOrigin;String get idType;String get identifier;ACPMobileVisitorAuthenticationState get authenticationState;};
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';enum ACPMobileVisitorAuthenticationState {UNKNOWN, AUTHENTICATED, LOGGED_OUT};
Cordova
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardACPIdentity.ACPMobileVisitorAuthenticationStateUnknown = 0;ACPIdentity.ACPMobileVisitorAuthenticationStateAuthenticated = 1;ACPIdentity.ACPMobileVisitorAuthenticationStateLoggedOut = 2;
C#
iOS
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current ACPMobileVisitorId
.
Copied to your clipboardACPMobileVisitorAuthenticationState.Unknown = 0;ACPMobileVisitorAuthenticationState.Authenticated = 1;ACPMobileVisitorAuthenticationState.LoggedOut = 2;
Android
VisitorID.AuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardVisitorID.AuthenticationState.Unknown = 0;VisitorID.AuthenticationState.Authenticated = 1;VisitorID.AuthenticationState.LoggedOut = 2;
AuthenticationState
This class is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardpublic enum AuthenticationState {UNKNOWN,AUTHENTICATED,LOGGED_OUT;}
VisitorID
This class is an identifier to be used with the Adobe Experience Cloud Identity Service.
Copied to your clipboardpublic class VisitorID {//Constructorpublic VisitorID(String idOrigin, String idType, String id, VisitorID.AuthenticationState authenticationState);public VisitorID.AuthenticationState getAuthenticationState();public final String getId();public final String getIdOrigin();public final String getIdType();}
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardtypedef NS_ENUM(NSUInteger,ACPMobileVisitorAuthenticationState) {ACPMobileVisitorAuthenticationStateUnknown = 0,ACPMobileVisitorAuthenticationStateAuthenticated = 1,ACPMobileVisitorAuthenticationStateLoggedOut = 2 };
ACPMobileVisitorId
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboard@interface ACPMobileVisitorId : NSObject@property(nonatomic, strong, nullable) NSString* idOrigin;@property(nonatomic, strong, nullable) NSString* idType;@property(nonatomic, strong, nullable) NSString* identifier;@property(nonatomic, readwrite) ACPMobileVisitorAuthenticationState authenticationState;@end
JavaScript
ACPVisitorID
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboardimport {ACPVisitorID} from '@adobe/react-native-acpcore';var visitorId = new ACPVisitorID(idOrigin?: string, idType: string, id?: string, authenticationState?: ACPMobileVisitorAuthenticationState);
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardimport {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';var state = ACPMobileVisitorAuthenticationState.AUTHENTICATED;//var state = ACPMobileVisitorAuthenticationState.LOGGED_OUT;//var state = ACPMobileVisitorAuthenticationState.UNKNOWN;
Dart
ACPVisitorID
This is an identifier to be used with the Adobe Experience Cloud Identity Service and it contains the origin, the identifier type, the identifier, and the authentication state of the visitor ID.
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';class ACPMobileVisitorId {String get idOrigin;String get idType;String get identifier;ACPMobileVisitorAuthenticationState get authenticationState;};
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardimport 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';enum ACPMobileVisitorAuthenticationState {UNKNOWN, AUTHENTICATED, LOGGED_OUT};
Cordova
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardACPIdentity.ACPMobileVisitorAuthenticationStateUnknown = 0;ACPIdentity.ACPMobileVisitorAuthenticationStateAuthenticated = 1;ACPIdentity.ACPMobileVisitorAuthenticationStateLoggedOut = 2;
C#
ACPAuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardACPIdentity.ACPAuthenticationState.UNKNOWN = 0;ACPIdentity.ACPAuthenticationState.AUTHENTICATED = 1;ACPIdentity.ACPAuthenticationState.LOGGED_OUT = 2;
C#
iOS
ACPMobileVisitorAuthenticationState
This is used to indicate the authentication state for the current ACPMobileVisitorId
.
Copied to your clipboardACPMobileVisitorAuthenticationState.Unknown = 0;ACPMobileVisitorAuthenticationState.Authenticated = 1;ACPMobileVisitorAuthenticationState.LoggedOut = 2;
Android
VisitorID.AuthenticationState
This is used to indicate the authentication state for the current VisitorID
.
Copied to your clipboardVisitorID.AuthenticationState.Unknown = 0;VisitorID.AuthenticationState.Authenticated = 1;VisitorID.AuthenticationState.LoggedOut = 2;