Android SDK WorkManager

ENGAGE® Android SDK WorkManager

The ENGAGE SDK uses WorkManager for job scheduling. ENGAGE SDK will initialize a default WorkManager if one does not exist. If the host app is currently disabling automatic initialization of WorkManager, then the host app will also need to disable automatic initialization of the ENGAGE SDK.

📘

Note: If you disable ENGAGE SDK automatic initialization, then you will need to initialize ENGAGE SDK in your application's onCreate method.

@Override
public void onCreate() {
  super.onCreate();
  // Initialize ENGAGE SDK
  EngageApp.initializeEngage(getApplicationContext());
}

Disabling WorkManager Auto-Initialization

If the host app wishes to disable WorkManager automatic initialization, then the following snippets must be included in the <application> tag of AndroidManifest.xml. These snippets disable WorkManager automatic initialization and ENGAGE SDK automatic initialization:

When host app uses androidx.startup

<provider
    android:name="androidx.startup.InitializationProvider"
    android:authorities=\"${applicationId}.androidx-startup"
    android:exported="false"
    tools:node=\"merge" >
    
    <!--            remove workmanager from startup-->
    <meta-data
        android:name="androidx.work.WorkManagerInitializer"
        android:value="androidx.startup"
        tools:node="remove" />
    <!--            remove Engage core auto init-->
    <meta-data
        android:name="com.firstorion.engage.core.EngageInitProvider"
        android:value="androidx.startup"
        tools:node="remove" />
</provider>

When host app does not use androidx.startup

In this case all androidx automatic startups including WorkManager and ENGAGE SDK will be disabled.

<!--If you want to disable android.startup completely. -->
<provider
    android:name="androidx.startup.InitializationProvider"
    android:authorities="${applicationId}.androidx-startup"
    tools:node="remove">
</provider>