Plugins

data-variant=info
data-slots=text
Plugins are available for Android only, starting with Mobile Core 3.10.0 (BOM 3.23.0).

Plugins are optional modules that add a specific capability to an Adobe Experience Platform Mobile SDK extension. For example, the Adobe Journey Optimizer extension uses the Live Updates plugin to display Android Live Updates, and the UI Builder plugin to display Adobe Journey Optimizer push templates.

You add plugins to Mobile Core when your app starts, before you register extensions. When an extension needs a capability, it uses the matching plugin that your app registered. If your app does not use a capability, you do not need to include or register its plugin.

Plugins and extensions

Extensions and plugins are both modules that you add to your app, but they serve different purposes.

Extensions
Plugins
Purpose
Provide the features of an Adobe solution or service, such as Analytics, Edge Network, or Adobe Journey Optimizer.
Provide a specific capability to an extension, such as rendering push templates.
Registration
Registered with the MobileCore.initialize or MobileCore.registerExtensions API.
Registered with the MobileCore.addPlugins API.
How they work
First-class components of the SDK. Each extension supports a set of related features and provides public APIs that your app uses to interact with the extension.
Additional, optional features that are developed separately from extensions, so your app can include them only if needed.
Requirements
Depend only on their core dependencies and must be registered with Mobile Core.
Used by extensions, so they must be added before the extensions that use them are registered.
When not added
The features of the extension are not available.
The features of the plugin are not available.

Benefits

Available plugins

The following plugins are available for the Adobe Journey Optimizer extension.

Plugin
Capability
Artifact
Minimum versions
Minimum BOM version
Live Updates (LiveUpdatePlugin)
Displays and tracks Android Live Updates sent from Adobe Journey Optimizer. Live Updates are ongoing notifications that show the progress of an activity, such as a delivery or a ride.
com.adobe.marketing.mobile:liveupdates
Live Updates 3.0.0, Messaging 3.13.0, Mobile Core 3.10.0
3.24.0
UI Builder (NotificationBuilderPlugin)
Builds user interface elements for the Adobe Journey Optimizer extension, starting with Adobe Journey Optimizer push templates. The Adobe Journey Optimizer extension displays and tracks the resulting notification.
com.adobe.marketing.mobile:notificationbuilder
Notification Builder 3.1.0, Messaging 3.13.0, Mobile Core 3.10.0
3.23.0
data-variant=warning
data-slots=text
Starting with Messaging 3.13.0 (BOM 3.23.0), the Adobe Journey Optimizer extension no longer includes the Notification Builder library. To continue displaying Adobe Journey Optimizer push templates, add the notificationbuilder dependency to your app and register the NotificationBuilderPlugin.

Add plugins to your app

Include plugins as app dependencies

Add the plugins that you want to use, along with Mobile Core and the Adobe Journey Optimizer extension, as dependencies to your project by including them in the app's Gradle file.

data-slots=heading, code
data-repeat=2
data-languages=Kotlin, Groovy

Kotlin

implementation(platform("com.adobe.marketing.mobile:sdk-bom:<bom-version>"))
implementation("com.adobe.marketing.mobile:core")
implementation("com.adobe.marketing.mobile:edge")
implementation("com.adobe.marketing.mobile:edgeidentity")
implementation("com.adobe.marketing.mobile:messaging")
implementation("com.adobe.marketing.mobile:liveupdates")
implementation("com.adobe.marketing.mobile:notificationbuilder")

Groovy

implementation platform('com.adobe.marketing.mobile:sdk-bom:<bom-version>')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:edge'
implementation 'com.adobe.marketing.mobile:edgeidentity'
implementation 'com.adobe.marketing.mobile:messaging'
implementation 'com.adobe.marketing.mobile:liveupdates'
implementation 'com.adobe.marketing.mobile:notificationbuilder'

Replace <bom-version> with the latest BOM version, listed on Current SDK versions. For the minimum versions, see Available plugins.

Register plugins with Mobile Core

Register your plugins with the MobileCore.addPlugins API in the onCreate method of your Application class, before you initialize the SDK. This ensures that plugins are available when extensions start processing, including when your app is started by a push notification.

You can register one or more plugins in a single call. Registering the same plugin instance more than once has no effect.

data-slots=heading, code
data-repeat=2
data-languages=Kotlin, Java

Kotlin

import com.adobe.marketing.mobile.MobileCore
import com.adobe.marketing.mobile.messaging.liveupdate.LiveUpdatePlugin
import com.adobe.marketing.mobile.notificationbuilder.NotificationBuilderPlugin
...
import android.app.Application
...

class MainApp : Application() {
  override fun onCreate() {
    super.onCreate()
    MobileCore.addPlugins(
      NotificationBuilderPlugin(),
      LiveUpdatePlugin(MyLiveUpdateStyleProvider())
    )

    MobileCore.initialize(this, "ENVIRONMENT_ID")
  }
}

Java

import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.messaging.liveupdate.LiveUpdatePlugin;
import com.adobe.marketing.mobile.notificationbuilder.NotificationBuilderPlugin;
...
import android.app.Application;
...
public class MainApp extends Application {
  @Override
  public void onCreate(){
    super.onCreate();
    MobileCore.addPlugins(
      new NotificationBuilderPlugin(),
      new LiveUpdatePlugin(new MyLiveUpdateStyleProvider())
    );

    MobileCore.initialize(this, "ENVIRONMENT_ID");
  }
}

In the examples above, MyLiveUpdateStyleProvider is a class in your app that implements ILiveUpdateStyleProvider and defines how Live Update notifications are styled.

Behavior when a plugin is not registered

If your app receives a push notification that requires a plugin that is not registered, the Adobe Journey Optimizer extension logs a warning and handles the notification as follows:

Push notification
Behavior without the plugin
Live Update
The notification is not displayed.
Push template
A standard notification is displayed instead of the push template.

API reference

API
Description
addPlugins
Registers one or more plugins with Mobile Core.
getPlugin
Returns the registered plugin for a given plugin type. This API is used by extensions.