Migrate from v2.0.0 to v3.0.0

Medallia Experience Orchestration SDK for Android v3.0.0 advances the minimum supported API to 28 and gets disabled for APIs less than 28. Compilation and integration is unaffected for APIs 21 - 27, however, the RequiresApi annotation has been added to all public APIs, which could affect your build compilation.

Medallia Experience Orchestration SDK for Android v3.0.0 also bumps the SDK's compile and target API to 34. This change will require adding coreLibraryDesugaring dependency to your project.

Also, APIs with Legacy Support have been removed. If they were used in your project, you would need to migrate to using standard APIs.

Also, starting with the Medallia Experience Orchestration SDK for Android v3.0.0, the Interaction Map logic was updated to validate programmatic interactions against the Interaction Map. Previously, this behavior was only applied to automatic interactions. This change was made to reduce the number of unnecessary interaction requests sent to MXO. To be able to send programmatic interactions, you will need to configure them accordingly.

  1. RequiresApi annotation.

    If an app's minimum supported API is lower than 28, any usage of an API will now result a build failure that must be resolved. The usual Android practice is to surround an API call with a version check in order to resolve build error in your project.

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
    	mxoConfigureLogging {
    		levels = mutableSetOf(MXOLogLevel.VERBOSE)
                    components = mutableSetOf(MXOLogComponent.ANY)
    	}
    }
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
    	mxoLoggingConfiguration = new MXOLoggingConfiguration.Builder()
    		.log(MXOLogLevel.VERBOSE)
    		.log(MXOLogComponent.ANY)
    		.build();
    }
  2. Add coreLibraryDesugaring dependency.

    Update your app-level build.gradle.kts or build.gradle with the following:

    1. Add dependency.
      dependencies {
          	coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:{LIB_VERSION}")
      }
      dependencies {
          	coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:{LIB_VERSION}"
      }
    2. Enable library support.
      compileOptions {
          	isCoreLibraryDesugaringEnabled = true
      }
      compileOptions {
          	coreLibraryDesugaringEnabled true
      }
  3. Remove Legacy Support.

    Migrate from using Legacy Support APIs to standard APIs by replacing the following code:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    	MedalliaMXO.sendInteraction(true, sendInteractionRequest);
    } else {
    	MedalliaMXO.sendInteractionLegacySupport(true, sendInteractionRequest);
    }
    

    with just this:

    MedalliaMXO.sendInteraction(true, sendInteractionRequest);
  4. Update Interaction Map for Programmatic Interactions.

    To allow programmatic interactions to work as expected, they must now be explicitly defined in your Interaction Map. Each interaction must include at least one Activity, Capture Point, or Optimization Point. Please update all existing Interaction Points inside your Touchpoint accordingly. This rule also applies to all newly created Interaction Points starting with this version.

    Note: Please, see more information about Interaction Map here.
You have now successfully migrated to the MXO SDK version 3.0.0.