Class Identity


  • public class Identity
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Class<? extends com.adobe.marketing.mobile.Extension> EXTENSION  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void appendVisitorInfoForURL​(String baseURL, com.adobe.marketing.mobile.AdobeCallback<String> callback)
      Appends Adobe visitor data to a URL string.
      static String extensionVersion()
      Returns the version of the Identity extension
      static void getExperienceCloudId​(com.adobe.marketing.mobile.AdobeCallback<String> callback)
      Retrieves the Adobe Experience Cloud Visitor ID from the Adobe Experience Cloud ID Service.
      static void getIdentifiers​(com.adobe.marketing.mobile.AdobeCallback<List<com.adobe.marketing.mobile.VisitorID>> callback)
      Returns all customer identifiers which were previously synced with the Adobe Experience Cloud.
      static void getUrlVariables​(com.adobe.marketing.mobile.AdobeCallback<String> callback)
      Gets Visitor ID Service variables in URL query parameter form for consumption in hybrid app.
      static void registerExtension()
      Deprecated.
      as of 2.0.0, use MobileCore.registerExtensions(List, AdobeCallback) with EXTENSION instead.
      static void syncIdentifier​(String identifierType, String identifier, com.adobe.marketing.mobile.VisitorID.AuthenticationState authenticationState)
      Updates the given customer ID with the Adobe Experience Cloud ID Service.
      static void syncIdentifiers​(Map<String,​String> identifiers)
      Updates the given customer IDs with the Adobe Experience Cloud ID Service.
      static void syncIdentifiers​(Map<String,​String> identifiers, com.adobe.marketing.mobile.VisitorID.AuthenticationState authenticationState)
      Updates the given customer IDs with the Adobe Experience Cloud ID Service.
    • Field Detail

      • EXTENSION

        public static final Class<? extends com.adobe.marketing.mobile.Extension> EXTENSION
    • Method Detail

      • extensionVersion

        public static String extensionVersion()
        Returns the version of the Identity extension
        Returns:
        The version as String
      • registerExtension

        @Deprecated
        public static void registerExtension()
        Deprecated.
        as of 2.0.0, use MobileCore.registerExtensions(List, AdobeCallback) with EXTENSION instead.
        Registers the extension with the Mobile SDK. This method should be called only once in your application class.
      • syncIdentifiers

        public static void syncIdentifiers​(@NonNull
                                           Map<String,​String> identifiers)
        Updates the given customer IDs with the Adobe Experience Cloud ID Service.

        Synchronizes the provided customer identifiers to the Adobe Experience Cloud ID Service. If a customer ID type matches an existing ID type and identifier, then it is updated with the new ID authentication state. New customer IDs are added. All given customer IDs are given the default authentication state of VisitorID.AuthenticationState.UNKNOWN.

        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, then calling this method results with no operations being performed.

        Parameters:
        identifiers - Map<String, String> containing identifier type as the key and identifier as the value. Both identifier type and identifier should be non empty and non null values, otherwise they will be ignored
      • syncIdentifiers

        public static void syncIdentifiers​(@NonNull
                                           Map<String,​String> identifiers,
                                           @NonNull
                                           com.adobe.marketing.mobile.VisitorID.AuthenticationState authenticationState)
        Updates the given customer IDs with the Adobe Experience Cloud ID Service.

        Synchronizes the provided customer identifiers to the Adobe Experience Cloud ID Service. If a customer ID type matches an existing ID type and identifiers, then it is updated with the new ID authentication state. New customer IDs are added.

        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, then calling this method results with no operations being performed.

        Parameters:
        identifiers - Map<String, String> containing identifier type as the key and identifier as the value. Both identifier type and identifier should be non empty and non null values, otherwise they will be ignored
        authenticationState - VisitorIDAuthenticationState value indicating authentication state for the user
      • syncIdentifier

        public static void syncIdentifier​(@NonNull
                                          String identifierType,
                                          @Nullable
                                          String identifier,
                                          @NonNull
                                          com.adobe.marketing.mobile.VisitorID.AuthenticationState authenticationState)
        Updates the given customer ID with the Adobe Experience Cloud ID Service.

        Synchronizes the provided customer identifier type key and value with the given authentication state to the Adobe Experience Cloud ID Service. If the given customer ID type already exists in the service, then it is updated with the new ID and authentication state. Otherwise a new customer ID is added.

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

        If the current SDK privacy status is MobilePrivacyStatus.OPT_OUT, then calling this method results with no operations being performed.

        Parameters:
        identifierType - String containing identifier type; should not be null or empty
        identifier - String containing identifier value; should not be null or empty
        authenticationState - VisitorIDAuthenticationState value indicating authentication state for the user
      • appendVisitorInfoForURL

        public static void appendVisitorInfoForURL​(@NonNull
                                                   String baseURL,
                                                   @NonNull
                                                   com.adobe.marketing.mobile.AdobeCallback<String> callback)
        Appends Adobe visitor data to a URL string.

        If the provided URL is null or empty, it is returned as is. Otherwise, the following information is added to the String returned in the AdobeCallback:

        • The adobe_mc attribute is an URL encoded list containing:
          • Experience Cloud ID (ECID)
          • Experience Cloud Org ID
          • Analytics Tracking ID, if available from Analytics
          • A timestamp taken when this request was made
        • The optional adobe_aa_vid attribute is the URL encoded Analytics Custom Visitor ID, if available from Analytics.
        Parameters:
        baseURL - String URL to which the visitor info needs to be appended
        callback - AdobeCallback invoked with the updated URL String; when an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (500ms) is met before the Identity URL variables are retrieved
      • getUrlVariables

        public static void getUrlVariables​(@NonNull
                                           com.adobe.marketing.mobile.AdobeCallback<String> callback)
        Gets Visitor ID Service variables in URL query parameter form for consumption in hybrid app.

        This method will return an appropriately formed String containing Visitor ID Service URL variables. There will be no leading & or ? punctuation, as the caller is responsible for placing it in their resulting URI in the correct location.

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

        • The adobe_mc attribute is an URL encoded list containing:
          • Experience Cloud ID (ECID)
          • Experience Cloud Org ID
          • Analytics Tracking ID, if available from Analytics
          • A timestamp taken when this request was made
        • The optional adobe_aa_vid attribute is the URL encoded Analytics Custom Visitor ID, if available from Analytics.
        Parameters:
        callback - AdobeCallback which will be called containing Visitor ID Service URL parameters; when an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (500ms) is met before the Identity URL variables are retrieved
      • getIdentifiers

        public static void getIdentifiers​(@NonNull
                                          com.adobe.marketing.mobile.AdobeCallback<List<com.adobe.marketing.mobile.VisitorID>> callback)
        Returns all customer identifiers which were previously synced with the Adobe Experience Cloud.
        Parameters:
        callback - AdobeCallback invoked with the list of VisitorID objects; when an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (500ms) is met before the customer identifiers are retrieved
      • getExperienceCloudId

        public static void getExperienceCloudId​(@NonNull
                                                com.adobe.marketing.mobile.AdobeCallback<String> callback)
        Retrieves the Adobe Experience Cloud Visitor ID from the Adobe Experience Cloud ID Service.

        The Adobe Experience Cloud ID (ECID) is generated at initial launch and is stored and used from that point forward. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

        Parameters:
        callback - AdobeCallback invoked with the ECID String; when an AdobeCallbackWithError is provided, an AdobeError can be returned in the eventuality of an unexpected error or if the default timeout (500ms) is met before the ECID is retrieved