Flutter Plugin Migration Guides

ENGAGE® Android SDK Migration Guides

Migrating to Version 1.0.7

The ENGAGE Flutter Plugin for Android is updated to include the auto-initialization of SDK instead of manually handling it.

This will require a couple minor changes in apps previously using Flutter version 1.0.6.

1. Remove Work Manager Setup

Since the auto-initialization is happening in Android now, so no need to provide the configuration in the AndroidManifest.xml file. Remove the below code from the AndroidManifest.xml.

<manifest xmlns:android = “http://schemas.android.com/apk/res/android”
xmlns:tools = “http://schemas.android.com/tools”> 

<application

android:label="testApp"
       android:name=".MyApplication"
       android:icon="@mipmap/ic_launcher">
 	.....
      ..... <!-- other code –--->
        .....
  
      <!-- Remove Provider Block-->
			<!--- Start --->
       <provider
           android:name="androidx.startup.InitializationProvider"
           android:authorities="${applicationId}.androidx-startup"
           android:exported="false"
           tools:node="merge" >
      
           <meta-data
               android:name="com.firstorion.engage.core.EngageInitProvider"
               android:value="androidx.startup"
               tools:node="remove" />
       </provider>
			<!--- End ---> 

</application>
</mainfest>


2. Remove ENGAGE SDK Initialization from Android Application Class

Since the auto-initialization is in place, there is no need to initialize the ENGAGE SDK in Application Class.

import com.firstorion.engage.core.EngageApp
import com.firstorion.engage.core.IEngageLoggingInterceptor
import io.flutter.app.FlutterApplication
import android.util.Log

class MyApplication : FlutterApplication(), IEngageLoggingInterceptor {
    
  override fun onCreate() {
        super.onCreate()
       
        //Remove Initialization for ENGAGE SDK ////
        EngageApp.initializeEngageForFlutterFirebase(this)
	    	////////////////////////////////////////////
    

        // logging interceptpr 
        EngageApp.Settings.setLoggingInterceptor(this)
    }
  
    override fun intercept(message: String, level: Int) {
        println("engage.app  $message" )
    }
  
}

3. Configure Firebase

Refer the ENGAGE Flutter Firebase configuration section as per the Host App setup. Link.


📘

NOTE:

No changes in the iOS SDK integration for ENGAGE Flutter Plugin v1.0.7