RDC Flutter SDK


Development Kits (SDKs) for mobile devices named Rabbit Mobile SDK. The Rabbit Mobile SDK will be used for tagging and collecting online data from the mobile application of the Rabbit’s each business unit.

The SDK will be used to collect the online behavior transaction of all Rabbit customers across all its business units and developed into the data analysis and data science model and eventually will be used for data monetization.

Flow Chart

Flow Chart


Rabbit Data Online Collection SDK for Flutter provides the following features.

In-line Configuration We will implement the overridable configuration by an in-line code configuration on the application bootstrap startup.

Caching The SDK will use cache manager as its in-memory cache to store a device’s static data and MongoDB Realm to keep the tracking data for later use.

Trigger to send data to the API backend Conditions before being sent to the API backend are checked for CPU, Memory, and Battery. All conditions to pass and SDK send data to the API backend.

Flow Chart

Flow Chart

Using the SDK


  • iOS 13.0 or later.
  • Android 8.0 or later.
  • Flutter 2 or later.

Platform Support

Android iOS
✔️ ✔️

Install plugin

rdc_flutter_sdk: ^0.0.13
realm: ^1.0.0


Dart Setup

required use Plugin https://pub.dev/packages/permission_handler

await Permission.location.request(); // android, IOS
await Permission.appTrackingTransparency.request(); // IOS only

Android Setup

add lines below in AndroidManifest.xml file

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

IOS Setup


<!-- Permission options for the `location` group -->

<string>Need location when in use</string>
<string>Always and when in use!</string>
<string>Older devices need location.</string>
<string>Can I have location always?</string>

<!-- Permission options for the `appTrackingTransparency` -->



##dart: PermissionGroup.appTrackingTransparency


##dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]



Method Params Remark
setAPIKey String key Authentication key
setEncryptionKey String key Encryption key for encryp data support only hive
setRotationTime int min = 1 Loop time for send data to API
setDataCollectionType DataCollectionType type = rotation Type send data to API immediately or loop
setRetentionDays int date = 30 Clear all data these sent to API
setDeleteAfterSent bool value = true Delete after sent or not.
setOfflineMode bool value = false Send data to API or not.
setRetryOnFailed int time = 3 Retries send data to API.
setTriggerCondition int cpu = 0, int memory = 0, int batteryLevel = 0 Condition for send data to API
setSessionExpire int min = 60 Session expire minute for forgeground
setSessionAutoExpire int min = 30 Session will end after inactive time
setConsent bool? value = null Consent from user
setPermissionMaid bool value = false User allow permission for get Maid only Android
setStorageCondition required int min, required int max Storage < min not save to local database and send API
Storage between min - max FIFO data in local database

Event Method

Method Params Remark
addEvent {required String eventName, required String eventValue, Map<dynamic, dynamic>? dataLayer} Add event log in local database
getEvents - Get list events in local database
uploadEvent - Upload list events send to API
clearAll - Delete all
clearCache - Delete only isSent
sessionStart - Start session in sdk
sessionEnd - End session in sdk

Custom Data Layer

The limitation is that it must be flat JSON only and All object have to varchar type

addEvent(dataLayer: {
    'custom_field_1': 'custom_field_1',
    'custom_field_2': 'custom_field_2',


Future<void> main() async {


    await Permission.location.request();
    await Permission.appTrackingTransparency.request();

    var config = RabbitDataConfig(
        apiKey: 'aStdsdJsskdjaolsdYUSsdsdSDijsdkjwe',   // required
        collectionType: DataCollectionType.event,       // default
        rotationTime: 1,                                // default
        retentionDays: 30,                              // default
        retryTime: 3,                                   // default
        deleteAfterSent: true,                          // default
        cpu: 90,                                        // default
        memory: 80,                                     // default
        betteryLevel: 30,                               // default
        dbType: DBType.hive,                            // default if you usege flutter version > 3 you can use both of hive and realm database.
        consent: null,                                  // default
        permissionMaid: false,                          // default
        sessionExpire: con.sessionExpireMin,            // default
        sessionAutoExpire: con.autoExpireMin,           // default
        offlineMode: true,                              // default
        storageMin: 1,                                  // default
        storageMax: 5                                   // default
    var rabbitData = await RabbitData.initializeInstance(config);

    await rabbitData.addEvent('init_app', 'init_app');



Realm Flutter SDK Reference

if usege flutter < version 2 please config RabbitDataConfig(dbType: DBType.hive) only

if usege flutter > version 3 you can use both RabbitDataConfig(dbType: DBType.hive) or RabbitDataConfig(dbType: DBType.realm)


Environment setup for Realm Flutter
Supported platforms are Flutter (iOS, Android, Windows, MacOS) and Dart standalone (Windows, MacOS and Linux)

Flutter ^3.0

For Flutter Desktop environment setup check the guide here

Cocoapods v1.11 or newer

CMake 3.21 or newer

Trying the example app

  1. Clone the repository. git clone https://bitbucket.org/bssh-rabbit/rdc-flutter-sdk/src/master/example

  2. Open the Folder file in Vscode or Android Studio.

  3. Cmd the flutter run in terminal.

The example app should launch.