CleverTap Flutter SDK

pub package

πŸ‘‹ Introduction

The CleverTap Flutter SDK for Mobile Customer Engagement and Analytics solutions.

For more information check out our website and documentation.

To get started, sign up here

πŸš€ Installation and Quick Start

  • To add the CleverTap Flutter SDK to your project, edit your project's pubspec.yaml file:
clevertap_plugin: 1.2.1
  • Run flutter packages get to install the SDK

  • Now, in your Dart code, you can use:

import 'package:clevertap_plugin/clevertap_plugin.dart';

πŸ‘¨β€πŸ’» Android

Add the following to your dependencies section in project/build.gradle

    dependencies {
            classpath ''
            classpath '' //<--- Mandatory for using Firebase Messaging, skip if not using FCM

Add the following to your dependencies section in app/build.gradle

        implementation ''
        implementation 'androidx.core:core:1.3.0'
        implementation 'androidx.fragment:fragment:1.1.0'
        //MANDATORY for App Inbox
        implementation 'androidx.appcompat:appcompat:1.2.0'
        implementation 'androidx.recyclerview:recyclerview:1.1.0'
        implementation 'androidx.viewpager:viewpager:1.0.0'
        implementation ''
        implementation 'com.github.bumptech.glide:glide:4.11.0'
        //For CleverTap Android SDK v3.6.4 and above add the following -
        implementation ''
        //Optional ExoPlayer Libraries for Audio/Video Inbox Messages. Audio/Video messages will be dropped without these dependencies
        implementation ''
        implementation ''
        implementation ''

At the end of the app/build.gradle file add the following

    apply plugin: '' //skip if not using FCM

In your app's Android Application class add the following code.

    public class MyApplication extends FlutterApplication {
        public void onCreate() {
            ActivityLifecycleCallback.register(this); //<--- Add this before super.onCreate()

If you do not have an Application class, add this to your AndroidManifest.xml


Add the following permissions which are needed by the CleverTap SDK

    <!-- Required to allow the app to send events and user profile information -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <!-- Recommended so that CleverTap knows when to attempt a network call -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Add your CleverTap Account ID and Token to your AndroidManifest.xml, within the tags.

        android:value="Your CleverTap Account ID"/>
        android:value="Your CleverTap Account Token"/>
    <!-- IMPORTANT: To force use Google AD ID to uniquely identify  users, use the following meta tag. GDPR mandates that if you are using this tag, there is prominent disclousure to your end customer in their application. Read more about GDPR here - -->

πŸ‘©β€πŸ’» iOS

After installation, you will need to integrate CleverTap SDK into your app.

  • Follow the integration instructions starting with Step 2 here.

  • Initialize CleverTap SDK by adding the following code snippet:

    • Import the CleverTap header in your AppDelegate file
    #import "CleverTap.h"
    #import "CleverTapPlugin.h"
    import CleverTapSDK
    import clevertap_plugin
    • In your didFinishLaunchingWithOptions: method notify the CleverTap Flutter SDK of application launch
    [CleverTap autoIntegrate]; // integrate CleverTap SDK using the autoIntegrate option
    [[CleverTapPlugin sharedInstance] applicationDidLaunchWithOptions:launchOptions];
    CleverTap.autoIntegrate() // integrate CleverTap SDK using the autoIntegrate option
    CleverTapPlugin.sharedInstance()?.applicationDidLaunch(options: launchOptions)

πŸ“‘ For more

πŸ†• Changelog

Refer to the CleverTap Flutter SDK Change Log.


If you have questions or concerns, you can reach out to the CleverTap support team from the CleverTap Dashboard.