Flutter SDK

Netcore CE provides a Flutter SDK that enables app developers to track and engage their users and view valuable analytical insights on our Netcore CE dashboard.

This guide will show you how to install the Netcore CE Flutter SDK in your Flutter project.

Installing Netcore CE Flutter Plugin

Implement plugin in pubspecs.yaml file under dependencies:

By using pub

smartech_base: ^3.5.0
smartech_push: ^3.5.0
smartech_appinbox: ^3.5.0

For Android SDK Setup

If you are building your Android app, follow the Basic Setup steps to install the Android SDK.

Step 1: Define Latest SDK version

Add below line in gradle.properties

# Version of smartech base SDK to use with Flutter
SMARTECH_BASE_SDK_VERSION=<<base_sdk_android_version>>

Step 2: Integrate the latest Netcore CE SDK

Make the following changes in the app-level build.gradle

api "com.netcore.android:smartech-sdk:${SMARTECH_BASE_SDK_VERSION}"
api "com.netcore.android:smartech-sdk:${SMARTECH_BASE_SDK_VERSION}"

Put your Smartech panel's app Id in the meta-data tag of your application's manifest file, it should be added within the application tag, but outside of any component within the application tag.
To get Smartech App ID, follow steps given here , else please get in touch with your account manager to get the value of SMT_APP_ID

<meta-data
   android:name="SMT_APP_ID"
   android:value="YOUR_SMARTECH_APP_ID_HERE" />

Step 3: Add below lines into your app level build.gradle file

defaultConfig{
    multiDexEnabled true // ADD THIS LINE
}

dependencies {
    implementation 'androidx.multidex:multidex:2.0.1' // ADD THIS LINE
}

Step 4: To initiate the Netcore CE SDK, Add below code in MyApplication.kt file

class MyApplication : FlutterApplication(){
    override fun onCreate() {
        super.onCreate()
          
        // Initialize Smartech Sdk
        Smartech.getInstance(WeakReference(applicationContext)).initializeSdk(this)
        // Add the below line for debugging logs
        Smartech.getInstance(WeakReference(applicationContext)).setDebugLevel(9)
        // Add the below line to track app install and update by smartech
        Smartech.getInstance(WeakReference(applicationContext)).trackAppInstallUpdateBySmartech()

        // Initialize Flutter Smartech Base Plugin
        SmartechBasePlugin.initializePlugin(this)
    }

    override fun onTerminate() {
        super.onTerminate()
        Log.d("onTerminate", "onTerminate")
    }
}
override fun onCreate() {
	super.onCreate()
	SmartechBasePlugin.Companion.initializePlugin(this);
}

Note : Make sure you have registered your Application class in the Application tag inside the AndroidManifest.xml file.

<application 
    android:name=".MyApplication">

For iOS SDK Setup

If you are building your iOS app, follow the Basic Setup steps to install the iOS SDK.

Choose Features

Now that the basic setup is completed, you can choose to move to either of the following:

  1. Customer Engagement Channels like Push Notifications & In-app Messages
  2. User & Event Tracking