Edit in GitHubLog an issue

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 clipboard
public static void appendVisitorInfoForURL(final String baseURL, final AdobeCallback<String> callback);
  • baseUrl is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is invoked after the updated URL is available.

Example

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

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

Swift

Syntax

Copied to your clipboard
static func append(to: URL?, withCallback: ((URL?) -> Void)?)
static func append(to: URL?, withCompletionHandler: ((URL?, Error?)-> Void)?)

Example

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

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

JavaScript

Syntax

Copied to your clipboard
appendVisitorInfoForURL(baseURL?: String): Promise<?string>;
  • baseUrl is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.

Example

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

Dart

Syntax

Copied to your clipboard
Future<String> appendToUrl (String url);
  • url is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.

Example

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

Cordova

Syntax

Copied to your clipboard
ACPIdentity.appendVisitorInfoForUrl = function(url, success, fail);
  • url (String) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • success is a callback containing the provided URL with the visitor information appended if the appendVisitorInfoForUrl API executed without any errors.
  • fail is a callback containing error information if the appendVisitorInfoForUrl API was executed with errors.

Example

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

C#

Syntax

Copied to your clipboard
public static void AppendToUrl(string url, AdobeIdentityAppendToUrlCallback callback)
  • url (String) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendToUrl API executed without any errors.

Example

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 clipboard
public unsafe static void AppendToUrl (NSUrl baseUrl, Action<NSUrl> callback);
  • baseUrl (NSUrl) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendToUrl API executed without any errors.

Android syntax

Copied to your clipboard
public unsafe static void AppendVisitorInfoForURL (string baseURL, IAdobeCallback callback);
  • baseURL (string) is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
  • callback is a callback containing the provided URL with the visitor information appended if the AppendVisitorInfoForURL API executed without any errors.

iOS example

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

Android example

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

Java

Copied to your clipboard
String identityExtensionVersion = Identity.extensionVersion();

Swift

Syntax

Copied to your clipboard
static func extensionVersion() -> String

Example

Copied to your clipboard
let identityVersion = ACPIdentity.extensionVersion()

Objective-C

Syntax

Copied to your clipboard
+ (nonnull NSString*) extensionVersion;

Example

Copied to your clipboard
NSString *identityVersion = [ACPIdentity extensionVersion];

JavaScript

Copied to your clipboard
ACPIdentity.extensionVersion().then(identityExtensionVersion => console.log("AdobeExperienceSDK: ACPIdentity version: " + identityExtensionVersion));

Dart

Copied to your clipboard
String identityExtensionVersion = FlutterACPIdentity.extensionVersion;

Cordova

Syntax

Copied to your clipboard
ACPIdentity.extensionVersion = function(success, fail);
  • success is a callback containing the ACPIdentity extension version if the extensionVersion API executed without any errors.
  • fail is a callback containing error information if the appendVisitorInfoForUrl API was executed with errors.

Example

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

C#

Syntax

Copied to your clipboard
public static string ExtensionVersion()

Example

Copied to your clipboard
string identityVersion = ACPIdentity.ExtensionVersion();

C#

Syntax

Copied to your clipboard
public static string ExtensionVersion ();

Example

Copied to your clipboard
string identityVersion = ACPIdentity.ExtensionVersion();

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 clipboard
public static void getExperienceCloudId(final AdobeCallback<String> callback);
  • callback is invoked after the ECID is available.

Example

Copied to your clipboard
Identity.getExperienceCloudId(new AdobeCallback<String>() {
@Override
public 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 clipboard
static 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 clipboard
ACPIdentity.getExperienceCloudId { (retrievedCloudId) in
// handle the retrieved ID here
}
ACPIdentity.getExperienceCloudId { (retrievedCloudId, error) in
if let error = error {
// handle error here
} else {
// handle the retrieved ID here
}
}

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 clipboard
getExperienceCloudId(): Promise<?string>;

Example

Copied to your clipboard
ACPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));

Dart

Syntax

Copied to your clipboard
Future<String> experienceCloudId;

Example

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

Cordova

Syntax

Copied to your clipboard
ACPIdentity.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 clipboard
ACPIdentity.getExperienceCloudId(function (handleCallback) {
console.log("AdobeExperienceSDK: experienceCloudId: " + handleCallback)
}, function (handleError) {
console.log("AdobeExperenceSDK: Failed to retrieve experienceCloudId : " + handleError);
});

C#

Syntax

Copied to your clipboard
public 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 clipboard
public 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 clipboard
public 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 clipboard
ACPIdentity.GetExperienceCloudId(callback => {
Console.WriteLine("Experience Cloud Id: " + callback);
});

Android example

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

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 clipboard
public static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
  • callback is invoked after the customer identifiers are available.

Example

Copied to your clipboard
Identity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {
@Override
public 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 clipboard
static 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 clipboard
ACPIdentity.getIdentifiers { (retrievedVisitorIds) in
// handle the retrieved identifiers here
}
ACPIdentity.getIdentifiersWithCompletionHandler { (retrievedVisitorIds, error) in
if let error = error {
// handle error here
} else {
// handle the retrieved identifiers here
}
}

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 clipboard
getIdentifiers(): Promise<Array<?ACPVisitorID>>;

Example

Copied to your clipboard
ACPIdentity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));

Dart

Syntax

Copied to your clipboard
Future<List<ACPMobileVisitorId>> identifiers;

Example

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

Cordova

Syntax

Copied to your clipboard
ACPIdentity.getIdentifiers(success, fail);
  • success is a callback containing the previously synced identifiers if the getIdentifiers API executed without any errors.
  • fail is a callback containing error information if the getIdentifiers API was executed with errors.

Example

Copied to your clipboard
ACPIdentity.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 clipboard
public 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 clipboard
public unsafe static void GetIdentifiers (Action<ACPMobileVisitorId[]> callback);
  • callback is a callback containing the previously synced identifiers if the GetIdentifiers API executed without any errors.

Android syntax

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

iOS example

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

Android example

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

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

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

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

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

JavaScript

Syntax

Copied to your clipboard
getUrlVariables(): Promise<?string>;

Example

Copied to your clipboard
ACPIdentity.getUrlVariables().then(urlVariables => console.log("AdobeExperenceSDK: query params = " + urlVariables));

Dart

Syntax

Copied to your clipboard
Future<String> urlVariables;

Example

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

Cordova

Syntax

Copied to your clipboard
ACPIdentity.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 clipboard
ACPIdentity.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 clipboard
public 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 clipboard
public 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 clipboard
public 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 clipboard
ACPIdentity.GetUrlVariables(callback => {
Console.WriteLine("Url variables: " + callback);
});

Android example

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

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 clipboard
public class MobileApp extends Application {
@Override
public 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 clipboard
func 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 clipboard
void Start() {
ACPIdentity.RegisterExtension();
}

C#

iOS

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

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

Android

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

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

Java

Syntax

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

Example

This is just an implementation example. For more information about advertising identifiers and how to handle them correctly in your mobile application, see Google Play Services documentation about 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
...
@Override
public void onResume() {
super.onResume();
...
new Thread(new Runnable() {
@Override
public 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 clipboard
static 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 clipboard
import AdSupport
import AppTrackingTransparency
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
if #available(iOS 14, *) {
setAdvertisingIdentiferUsingTrackingManager()
} else {
// Fallback on earlier versions
setAdvertisingIdentifierUsingIdentifierManager()
}
}
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) in
var idfa: String = "";
switch (status) {
case .authorized:
idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
case .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 identifier
NSString *idfa = nil;
if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
} else {
[ACPCore log:ACPMobileLogLevelDebug
tag:@"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:ACPMobileLogLevelDebug
tag:@"AppDelegateExample"
message:@"Advertising Tracking is denied by the user, cannot process the advertising identifier"];
break;
case ATTrackingManagerAuthorizationStatusNotDetermined:
[ACPCore log:ACPMobileLogLevelDebug
tag:@"AppDelegateExample"
message:@"Advertising Tracking is not determined, cannot process the advertising identifier"];
break;
case ATTrackingManagerAuthorizationStatusRestricted:
[ACPCore log:ACPMobileLogLevelDebug
tag:@"AppDelegateExample"
message:@"Advertising Tracking is restricted by the user, cannot process the advertising identifier"];
break;
}
[ACPCore setAdvertisingIdentifier:idfa];
}];
}

JavaScript

Syntax

Copied to your clipboard
setAdvertisingIdentifier(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 clipboard
ACPCore.setAdvertisingIdentifier("ADVTID");

Dart

Syntax

Copied to your clipboard
Future<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 clipboard
FlutterACPCore.setAdvertisingIdentifier("ADVTID");

Cordova

Syntax

Copied to your clipboard
ACPCore.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 clipboard
ACPCore.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 clipboard
public 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 clipboard
ACPCore.SetAdvertisingIdentifier("ADVTID");

C#

iOS syntax

Copied to your clipboard
public 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 clipboard
public 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 clipboard
ACPCore.SetAdvertisingIdentifier("ADVTID");

Java

Syntax

Copied to your clipboard
public 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 SDK
MobileCore.setPushIdentifier(token);

Swift

Syntax

Copied to your clipboard
static 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 device
ACPCore.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];

JavaScript

Syntax

Copied to your clipboard
ACPCore.setPushIdentifier(pushIdentifier);
  • pushIdentifier is a string that contains the device token for push notifications.

Example

Copied to your clipboard
ACPCore.setPushIdentifier("pushID");

Java

Syntax

Copied to your clipboard
public 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 clipboard
Identity.syncIdentifier("idType",
"idValue",
VisitorID.AuthenticationState.AUTHENTICATED);

Swift

Syntax

Copied to your clipboard
static 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 the identifier type or identifier 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 clipboard
ACPIdentity.syncIdentifier("idType", identifier: "idValue", authentication: ACPMobileVisitorAuthenticationState.unknown)

Objective-C

Syntax

Copied to your clipboard
+ (void) syncIdentifier: (nonnull NSString*) identifierType
identifier: (nonnull NSString*) identifier
authentication: (ADBMobileVisitorAuthenticationState) authenticationState;

Example

Copied to your clipboard
[ACPIdentity syncIdentifier:@"idType" identifier:@"idValue" authentication:ACPMobileVisitorAuthenticationStateUnknown];

JavaScript

Syntax

Copied to your clipboard
syncIdentifier(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 the identifier type or identifier 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 clipboard
import {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';
ACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);

Dart

Syntax

Copied to your clipboard
Future<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 the identifier type or identifier 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 clipboard
import 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';
FlutterACPIdentity.syncIdentifier("identifierType", "identifier", ACPMobileVisitorAuthenticationState.AUTHENTICATED);

Cordova

Syntax

Copied to your clipboard
ACPIdentity.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 the identifier type or identifier 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 clipboard
ACPIdentity.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 clipboard
public 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 the identifier type or identifier 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 clipboard
ACPIdentity.SyncIdentifier("idType1", "idValue1", ACPIdentity.ACPAuthenticationState.AUTHENTICATED);

C#

iOS syntax

Copied to your clipboard
public 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 the identifier type or identifier 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 clipboard
public 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 the identifier type or identifier 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 clipboard
ACPIdentity.SyncIdentifier("idType1", "idValue1", ACPMobileVisitorAuthenticationState.Authenticated);

Android example

Copied to your clipboard
ACPIdentity.SyncIdentifier("idType1", "idValue1", VisitorID.AuthenticationState.Authenticated);

Java

Syntax

Copied to your clipboard
public 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 clipboard
Map<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 clipboard
static func syncIdentifiers(_ identifiers: [AnyHashable : Any]?)
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

Example

Copied to your clipboard
let 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 clipboard
NSDictionary *ids = @{@"idType1":@"idValue1",
@"idType2":@"idValue2",
@"idType3":@"idValue3"};
[ACPIdentity syncIdentifiers:ids];

JavaScript

Syntax

Copied to your clipboard
syncIdentifiers(identifiers?: {string: string});
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

Example

Copied to your clipboard
ACPIdentity.syncIdentifiers({"id1": "identifier1"});

Dart

Syntax

Copied to your clipboard
Future<void> syncIdentifiers (Map<String, String> identifiers);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

Example

Copied to your clipboard
FlutterACPIdentity.syncIdentifiers({"idType1":"idValue1",
"idType2":"idValue2",
"idType3":"idValue3"});

Cordova

Syntax

Copied to your clipboard
ACPIdentity.syncIdentifiers = function(identifiers, success, fail);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
ACPIdentity.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 clipboard
public static void SyncIdentifiers(Dictionary<string, string> identifiers)
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

Example

Copied to your clipboard
Dictionary<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 clipboard
public static void SyncIdentifiers (NSDictionary identifiers);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

Android syntax

Copied to your clipboard
public unsafe static void SyncIdentifiers (IDictionary<string, string> identifiers);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier type, then it will be ignored.

iOS example

Copied to your clipboard
var 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 clipboard
var 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 clipboard
public 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 clipboard
Map<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 clipboard
static func syncIdentifiers(_ identifiers: [AnyHashable : Any]?, authentication authenticationState: ACPMobileVisitorAuthenticationState)
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
let 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 clipboard
NSDictionary *ids = @{@"idType1":@"idValue1",
@"idType2":@"idValue2",
@"idType3":@"idValue3"};
[ACPIdentity syncIdentifiers:ids authentication:ACPMobileVisitorAuthenticationStateAuthenticated];

JavaScript

Syntax

Copied to your clipboard
syncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
import {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';
ACPIdentity.syncIdentifiersWithAuthState({"id1": "identifier1"}, ACPMobileVisitorAuthenticationState.UNKNOWN);

Dart

Syntax

Copied to your clipboard
Future<void> syncIdentifiersWithAuthState (Map<String, String> identifiers, ACPMobileVisitorAuthenticationState authState);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
import 'package:flutter_acpcore/src/acpmobile_visitor_id.dart';
FlutterACPIdentity.syncIdentifiersWithAuthState({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, ACPMobileVisitorAuthenticationState.UNKNOWN);

Cordova

Syntax

Copied to your clipboard
ACPIdentity.syncIdentifiers = function(identifiers, authState, success, fail);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
ACPIdentity.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 clipboard
public 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 an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
Dictionary<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 clipboard
public static void SyncIdentifiers (NSDictionary identifiers, ACPMobileVisitorAuthenticationState authenticationState);
  • The identifiers dictionary contains identifiers, and each identifier contains an identifier type as the key and an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
public 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 an identifier as the value. If any of the identifier pairs contains an empty or null value as the identifier 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 clipboard
var 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 clipboard
var ids = new Dictionary<string, string>();
ids.Add("idsType1", "idValue1");
ids.Add("idsType2", "idValue2");
ids.Add("idsType3", "idValue3");
ACPIdentity.SyncIdentifiers(ids, VisitorID.AuthenticationState.LoggedOut);

AuthenticationState

This class is used to indicate the authentication state for the current VisitorID.

Copied to your clipboard
public 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 clipboard
public class VisitorID {
//Constructor
public 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 clipboard
typedef 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 clipboard
import {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 clipboard
import {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 clipboard
import '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 clipboard
import '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 clipboard
ACPIdentity.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 clipboard
ACPIdentity.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 clipboard
ACPMobileVisitorAuthenticationState.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 clipboard
VisitorID.AuthenticationState.Unknown = 0;
VisitorID.AuthenticationState.Authenticated = 1;
VisitorID.AuthenticationState.LoggedOut = 2;
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.