Class Optimize


  • public class Optimize
    extends Object
    Public class containing APIs for the Optimize extension.
    • Field Detail

      • EXTENSION

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

      • extensionVersion

        @NonNull
        public static String extensionVersion()
        Returns the version of the Optimize extension.
        Returns:
        String containing the current installed version of this extension.
      • registerExtension

        @Deprecated
        public static void registerExtension()
        Deprecated.
        Registers the extension with the Mobile Core.

        Note: This method should be called only once in your application class.

      • updatePropositions

        public static void updatePropositions​(@NonNull
                                              List<DecisionScope> decisionScopes,
                                              @Nullable
                                              Map<String,​Object> xdm,
                                              @Nullable
                                              Map<String,​Object> data)
        This API dispatches an Event for the Edge network extension to fetch decision propositions, for the provided decision scopes list, from the decisioning services enabled in the Experience Edge network.

        The returned decision propositions are cached in-memory in the Optimize SDK extension and can be retrieved using getPropositions(List, AdobeCallback) API.

        Parameters:
        decisionScopes - List<DecisionScope> containing scopes for which offers need to be updated.
        xdm - Map<String, Object> containing additional XDM-formatted data to be sent in the personalization query request.
        data - Map<String, Object> containing additional free-form data to be sent in the personalization query request.
      • getPropositions

        public static void getPropositions​(@NonNull
                                           List<DecisionScope> decisionScopes,
                                           @NonNull
                                           com.adobe.marketing.mobile.AdobeCallback<Map<DecisionScope,​Proposition>> callback)
        This API retrieves the previously fetched propositions, for the provided decision scopes, from the in-memory extension propositions cache.
        Parameters:
        decisionScopes - List<DecisionScope> containing scopes for which offers need to be requested.
        callback - AdobeCallbackWithError<Map<DecisionScope, Proposition>> which will be invoked when decision propositions are retrieved from the local cache.
      • onPropositionsUpdate

        public static void onPropositionsUpdate​(@NonNull
                                                com.adobe.marketing.mobile.AdobeCallback<Map<DecisionScope,​Proposition>> callback)
        This API registers a permanent callback which is invoked whenever the Edge extension dispatches a response Event received from the Experience Edge Network upon a personalization query.

        The personalization query requests can be triggered by the updatePropositions(List, Map, Map) API, Edge extension sendEvent(ExperienceEvent, EdgeCallback) API or launch consequence rules.

        Parameters:
        callback - AdobeCallbackWithError<Map<DecisionScope, Proposition>> which will be invoked when decision propositions are received from the Edge network.
      • clearCachedPropositions

        public static void clearCachedPropositions()
        Clears the client-side in-memory propositions cache.