Identity API reference
appendToURL / appendVisitorInfoForURL
This API appends Adobe visitor information to the query component of the specified URL.
If the provided URL is null or empty, it is returned as is. Otherwise, the following information is added to the query component of the specified URL and is returned in the callback function:
- The
adobe_mc
attribute is a URL encoded list that contains:MCMID
- Experience Cloud ID (ECID)MCORGID
- Experience Cloud Org 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(@NonNull final String baseURL, @NonNull 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);}});
Swift
Syntax
Copied to your clipboardstatic func appendTo(url: URL?, completion: @escaping (URL?, Error?) -> Void)
- url is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
- completion is invoked after the updated URL is available or Error if an unexpected exception occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.appendTo(url: URL(string: "https://example.com")) { 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: (NSURL * _Nullable baseUrl) completion: ^(NSURL * _Nullable urlWithVisitorData, NSError * _Nullable error) completion;
Example
Copied to your clipboardNSURL* url = [NSURL URLWithString:@"https://example.com"];[AEPMobileIdentity appendToUrl:url completion:^(NSURL * _Nullable urlWithVisitorData, 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}}}];
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(@NonNull final String baseURL, @NonNull 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);}});
Swift
Syntax
Copied to your clipboardstatic func appendTo(url: URL?, completion: @escaping (URL?, Error?) -> Void)
- url is the URL to which the visitor information needs to be appended. If the visitor information is nil or empty, the URL is returned as is.
- completion is invoked after the updated URL is available or Error if an unexpected exception occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.appendTo(url: URL(string: "https://example.com")) { 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: (NSURL * _Nullable baseUrl) completion: ^(NSURL * _Nullable urlWithVisitorData, NSError * _Nullable error) completion;
Example
Copied to your clipboardNSURL* url = [NSURL URLWithString:@"https://example.com"];[AEPMobileIdentity appendToUrl:url completion:^(NSURL * _Nullable urlWithVisitorData, 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}}}];
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 var extensionVersion: String
Example
Copied to your clipboardlet identityExtensionVersion = Identity.extensionVersion
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *identityVersion = [AEPMobileIdentity extensionVersion];
Java
Syntax
Copied to your clipboard@NonNullpublic static String extensionVersion();
Example
Copied to your clipboardString identityExtensionVersion = Identity.extensionVersion();
Swift
Syntax
Copied to your clipboardstatic var extensionVersion: String
Example
Copied to your clipboardlet identityExtensionVersion = Identity.extensionVersion
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *identityVersion = [AEPMobileIdentity extensionVersion];
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(@NonNull 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}});
Swift
Syntax
Copied to your clipboard@objc(getExperienceCloudId:)static func getExperienceCloudId(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with String after the ECID is available, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.getExperienceCloudId { ecid, error inif let error = error {// handle error here} else {// handle the retrieved ID here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getExperienceCloudId: ^(NSString * _Nullable ecid, NSError * _Nullable error) completion;
Example
Copied to your clipboard[AEPMobileIdentity getExperienceCloudId:^(NSString * _Nullable ecid, NSError *error) {if (error) {// handle error here} else {// handle the retrieved ID here}}];
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(@NonNull 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}});
Swift
Syntax
Copied to your clipboard@objc(getExperienceCloudId:)static func getExperienceCloudId(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with String after the ECID is available, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.getExperienceCloudId { ecid, error inif let error = error {// handle error here} else {// handle the retrieved ID here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getExperienceCloudId: ^(NSString * _Nullable ecid, NSError * _Nullable error) completion;
Example
Copied to your clipboard[AEPMobileIdentity getExperienceCloudId:^(NSString * _Nullable ecid, NSError *error) {if (error) {// handle error here} else {// handle the retrieved ID here}}];
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(@NonNull 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}});
Swift
Syntax
Copied to your clipboard@objc(getIdentifiers:)static func getIdentifiers(completion: @escaping ([Identifiable]?, Error?) -> Void)
- completion is invoked with a list of Identifiable objects after the customer identifiers are available, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.getIdentifiers { identifiers, error inif let error = error {// handle error here} else {// handle the retrieved identifiers here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getIdentifiers: ^(NSArray<id<AEPIdentifiables>> * _Nullable identifiers, NSError * _Nullable error) completion;
Example
Copied to your clipboard[[AEPMobileIdentity getIdentifiers:^(NSArray<id<AEPIdentifiable>> * _Nullable identifiers, NSError *error) {if (error) {// handle error here} else {// handle the retrieved identifiers here}}];
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(@NonNull 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}});
Swift
Syntax
Copied to your clipboard@objc(getIdentifiers:)static func getIdentifiers(completion: @escaping ([Identifiable]?, Error?) -> Void)
- completion is invoked with a list of Identifiable objects after the customer identifiers are available, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error.
Example
Copied to your clipboardIdentity.getIdentifiers { identifiers, error inif let error = error {// handle error here} else {// handle the retrieved identifiers here}}
Objective-C
Syntax
Copied to your clipboard+ (void) getIdentifiers: ^(NSArray<id<AEPIdentifiables>> * _Nullable identifiers, NSError * _Nullable error) completion;
Example
Copied to your clipboard[[AEPMobileIdentity getIdentifiers:^(NSArray<id<AEPIdentifiable>> * _Nullable identifiers, NSError *error) {if (error) {// handle error here} else {// handle the retrieved identifiers here}}];
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);}});
Swift
Syntax
Copied to your clipboard@objc(getUrlVariables:)static func getUrlVariables(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with String containing the visitor identifiers as a query string, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error. The default timeout of 500ms.
Example
Copied to your clipboardIdentity.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: ^(NSString * _Nullable urlVariables, NSError * _Nullable error) completion;
Example
Copied to your clipboard[AEPMobileIdentity getUrlVariables:^(NSString * _Nullable urlVariables, NSError *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]];}}}];
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);}});
Swift
Syntax
Copied to your clipboard@objc(getUrlVariables:)static func getUrlVariables(completion: @escaping (String?, Error?) -> Void)
- completion is invoked with String containing the visitor identifiers as a query string, or Error if an unexpected error occurs or the request times out. The returned
Error
contains the AEPError code of the specific error. The default timeout of 500ms.
Example
Copied to your clipboardIdentity.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: ^(NSString * _Nullable urlVariables, NSError * _Nullable error) completion;
Example
Copied to your clipboard[AEPMobileIdentity getUrlVariables:^(NSString * _Nullable urlVariables, NSError *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]];}}}];
registerExtension
This API has been deprecated starting in v2.0.0 and removed in v3.0.0 of the Android mobile extension.
Use MobileCore.registerExtensions()
API instead.
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.
Android
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}}}
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}}}
resetIdentities
Clears all identities stored in the Identity extension and generates a new Experience Cloud ID (ECID). Using this API does not remove the identifiers from the server-side service.
This is a destructive action, since once an ECID is removed it cannot be reused. The new ECID generated by this API can increase metrics like unique visitors when a new user profile is created.
Some example use cases for this API are:
- During debugging, to see how new ECIDs (and other identifiers paired with it) behave with existing rules and metrics.
- A last-resort reset for when an ECID should no longer be used.
This API is not recommended for:
- Resetting a user's privacy settings; see Privacy and GDPR.
- Removing existing custom identifiers; use the
syncIdentifier
API instead. - Removing a previously synced advertising identifier after the advertising tracking settings were changed by the user; use the
setAdvertisingIdentifier
API instead.
See MobileCore.resetIdentities
for more details.
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(@Nullable 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 the 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@objc(setAdvertisingIdentifier:)public static func setAdvertisingIdentifier(_ identifier: String?)
- identifier 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 {Log.debug(label: "AppDelegateExample","Advertising Tracking is disabled by the user, cannot process the advertising identifier.");}MobileCore.setAdvertisingIdentifier(idfa);}@available(iOS 14, *)func setAdvertisingIdentiferUsingTrackingManager() {ATTrackingManager.requestTrackingAuthorization { (status) invar idfa: String = "";switch (status) {case .authorized:idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidStringcase .denied:Log.debug(label: "AppDelegateExample","Advertising Tracking is denied by the user, cannot process the advertising identifier.")case .notDetermined:Log.debug(label: "AppDelegateExample","Advertising Tracking is not determined, cannot process the advertising identifier.")case .restricted:Log.debug(label: "AppDelegateExample","Advertising Tracking is restricted by the user, cannot process the advertising identifier.")}MobileCore.setAdvertisingIdentifier(idfa)}}
Objective-C
Syntax
Copied to your clipboard+ (void) setAdvertisingIdentifier: (NSString * _Nullable identifier);
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 {[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is disabled by the user, cannot process the advertising identifier"];}[AEPMobileCore 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:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is denied by the user, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusNotDetermined:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is not determined, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusRestricted:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is restricted by the user, cannot process the advertising identifier"];break;}[AEPMobileCore setAdvertisingIdentifier:idfa];}];}
Java
Syntax
Copied to your clipboardpublic static void setAdvertisingIdentifier(@Nullable 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 the 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@objc(setAdvertisingIdentifier:)public static func setAdvertisingIdentifier(_ identifier: String?)
- identifier 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 {Log.debug(label: "AppDelegateExample","Advertising Tracking is disabled by the user, cannot process the advertising identifier.");}MobileCore.setAdvertisingIdentifier(idfa);}@available(iOS 14, *)func setAdvertisingIdentiferUsingTrackingManager() {ATTrackingManager.requestTrackingAuthorization { (status) invar idfa: String = "";switch (status) {case .authorized:idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidStringcase .denied:Log.debug(label: "AppDelegateExample","Advertising Tracking is denied by the user, cannot process the advertising identifier.")case .notDetermined:Log.debug(label: "AppDelegateExample","Advertising Tracking is not determined, cannot process the advertising identifier.")case .restricted:Log.debug(label: "AppDelegateExample","Advertising Tracking is restricted by the user, cannot process the advertising identifier.")}MobileCore.setAdvertisingIdentifier(idfa)}}
Objective-C
Syntax
Copied to your clipboard+ (void) setAdvertisingIdentifier: (NSString * _Nullable identifier);
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 {[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is disabled by the user, cannot process the advertising identifier"];}[AEPMobileCore 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:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is denied by the user, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusNotDetermined:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is not determined, cannot process the advertising identifier"];break;case ATTrackingManagerAuthorizationStatusRestricted:[AEPLog debugWithLabel:@"AppDelegateExample"message:@"Advertising Tracking is restricted by the user, cannot process the advertising identifier"];break;}[AEPMobileCore setAdvertisingIdentifier:idfa];}];}
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(@Nullable 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 clipboard@objc(setPushIdentifier:)public static func setPushIdentifier(_ deviceToken: Data?)
- 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 deviceMobileCore.setPushIdentifier(deviceToken)
Objective-C
Syntax
Copied to your clipboard+ (void) setPushIdentifier: (NSString * _Nullable deviceToken);
Example
Copied to your clipboard// Set the deviceToken that the APNS has assigned to the device[AEPMobileCore setPushIdentifier:deviceToken];
Java
Syntax
Copied to your clipboardpublic static void setPushIdentifier(@Nullable 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 clipboard@objc(setPushIdentifier:)public static func setPushIdentifier(_ deviceToken: Data?)
- 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 deviceMobileCore.setPushIdentifier(deviceToken)
Objective-C
Syntax
Copied to your clipboard+ (void) setPushIdentifier: (NSString * _Nullable deviceToken);
Example
Copied to your clipboard// Set the deviceToken that the APNS has assigned to the device[AEPMobileCore 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(@NonNull final String identifierType,@Nullable final String identifier,@NonNull 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 clipboard@objc(syncIdentifierWithType:identifier:authenticationState:)static func syncIdentifier(identifierType: String, identifier: String, authenticationState: MobileVisitorAuthenticationState)
- 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 theidentifierType
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - The authenticationState (MobileVisitorAuthenticationState) value indicates the authentication state for the user and contains one of the MobileVisitorAuthenticationState values.
Example
Copied to your clipboardIdentity.syncIdentifier(identifierType: "idType",identifier: "idValue",authentication: .unknown)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifierWithType: (NSString * _Nonnull identifierType)identifier: (NSString * _Nonnull identifier)authentication: (enum AEPAuthenticationState authenticationState);
Example
Copied to your clipboard[AEPMobileIdentity syncIdentifierWithType:@"idType"identifier:@"idValue"authenticationState:AEPMobileVisitorAuthStateUnknown];
Java
Syntax
Copied to your clipboardpublic static void syncIdentifier(@NonNull final String identifierType,@Nullable final String identifier,@NonNull 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 clipboard@objc(syncIdentifierWithType:identifier:authenticationState:)static func syncIdentifier(identifierType: String, identifier: String, authenticationState: MobileVisitorAuthenticationState)
- 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 theidentifierType
oridentifier
contains a null or an empty string, the identifier is ignored by the Identity extension. - The authenticationState (MobileVisitorAuthenticationState) value indicates the authentication state for the user and contains one of the MobileVisitorAuthenticationState values.
Example
Copied to your clipboardIdentity.syncIdentifier(identifierType: "idType",identifier: "idValue",authentication: .unknown)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifierWithType: (NSString * _Nonnull identifierType)identifier: (NSString * _Nonnull identifier)authentication: (enum AEPAuthenticationState authenticationState);
Example
Copied to your clipboard[AEPMobileIdentity syncIdentifierWithType:@"idType"identifier:@"idValue"authenticationState:AEPMobileVisitorAuthStateUnknown];
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(@NonNull 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 clipboard@objc(syncIdentifiers:)static func syncIdentifiers(identifiers: [String: String]?)
- The identifiers dictionary contains identifier type as the key and identifier as the value, both identifier type and identifier should be non empty and non nil values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];Identity.syncIdentifiers(identifiers: ids)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (NSDictionary<NSString *, NSString *> * _Nullable identifiers);
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[AEPMobileIdentity syncIdentifiers:ids];
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(@NonNull 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 clipboard@objc(syncIdentifiers:)static func syncIdentifiers(identifiers: [String: String]?)
- The identifiers dictionary contains identifier type as the key and identifier as the value, both identifier type and identifier should be non empty and non nil values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];Identity.syncIdentifiers(identifiers: ids)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (NSDictionary<NSString *, NSString *> * _Nullable identifiers);
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[AEPMobileIdentity 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(@NonNull final Map<String, String> identifiers,@NonNull final VisitorID.AuthenticationState authenticationState)
- 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 clipboard@objc(syncIdentifiers:authenticationState:)static func syncIdentifiers(identifiers: [String: String]?, authenticationState: MobileVisitorAuthenticationState)
- The identifiers dictionary contains identifier type as the key and identifier as the value, both identifier type and identifier should be non empty and non nil values.
- The authenticationState (MobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the MobileVisitorAuthenticationState values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];Identity.syncIdentifiers(identifiers: ids, authenticationState: .authenticated)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (NSDictionary<NSString *, NSString *> * _Nullable identifiers)authentication: (enum AEPAuthenticationState authenticationState);
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[AEPMobileIdentity syncIdentifiers:ids authenticationState:AEPMobileVisitorAuthStateAuthenticated];
Java
Syntax
Copied to your clipboardpublic static void syncIdentifiers(@NonNull final Map<String, String> identifiers,@NonNull final VisitorID.AuthenticationState authenticationState)
- 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 clipboard@objc(syncIdentifiers:authenticationState:)static func syncIdentifiers(identifiers: [String: String]?, authenticationState: MobileVisitorAuthenticationState)
- The identifiers dictionary contains identifier type as the key and identifier as the value, both identifier type and identifier should be non empty and non nil values.
- The authenticationState (MobileVisitorAuthenticationState) indicates the authentication state of the user and contains one of the MobileVisitorAuthenticationState values.
Example
Copied to your clipboardlet ids : [String: String] = ["idType1":"idValue1","idType2":"idValue2","idType3":"idValue3"];Identity.syncIdentifiers(identifiers: ids, authenticationState: .authenticated)
Objective-C
Syntax
Copied to your clipboard+ (void) syncIdentifiers: (NSDictionary<NSString *, NSString *> * _Nullable identifiers)authentication: (enum AEPAuthenticationState authenticationState);
Example
Copied to your clipboardNSDictionary *ids = @{@"idType1":@"idValue1",@"idType2":@"idValue2",@"idType3":@"idValue3"};[AEPMobileIdentity syncIdentifiers:ids authenticationState:AEPMobileVisitorAuthStateAuthenticated];
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();}
MobileVisitorAuthenticationState
This is used to indicate the authentication state for the current Identifiable
.
Copied to your clipboard@objc(AEPMobileVisitorAuthState) public enum MobileVisitorAuthenticationState: Int, Codable {case unknown = 0case authenticated = 1case loggedOut = 2}
Identifiable
Copied to your clipboard@objc(AEPIdentifiable) public protocol Identifiable {/// Origin of the identifiervar origin: String? { get }/// Type of the identifiervar type: String? { get }/// The identifiervar identifier: String? { get }/// The authentication state for the identifiervar authenticationState: MobileVisitorAuthenticationState { get }}
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();}
MobileVisitorAuthenticationState
This is used to indicate the authentication state for the current Identifiable
.
Copied to your clipboard@objc(AEPMobileVisitorAuthState) public enum MobileVisitorAuthenticationState: Int, Codable {case unknown = 0case authenticated = 1case loggedOut = 2}
Identifiable
Copied to your clipboard@objc(AEPIdentifiable) public protocol Identifiable {/// Origin of the identifiervar origin: String? { get }/// Type of the identifiervar type: String? { get }/// The identifiervar identifier: String? { get }/// The authentication state for the identifiervar authenticationState: MobileVisitorAuthenticationState { get }}