one-sdk-flutter

The Thunderhead ONE SDK Flutter Plugin for iOS and Android.

Examples

Check out the examples folder to see integration examples.

Installation

To install the Thunderhead ONE Flutter Plugin, go to your pubspec.yaml and add the dependency:

one_sdk_flutter:
  git:
    url: https://github.com/thunderheadone/one-sdk-flutter.git

Disable automatic Interaction detection

By disabling automatic Interaction detection, the SDK will no longer automatically send Interaction requests as native iOS View Controllers or Android Activities or Fragments are presented on screen.

It is recommended to disable automatic Interaction detection in Flutter applications as the SDK does not recognize Flutter or web view elements, so it becomes your responsibility to send them when needed by using the send Interaction methods outlined below.

For native applications where only a part of the app uses Flutter, you may want to ignore disabling automatic Interaction detection to automatically detect native Interactions.

You can disable automatic Interaction detection by calling the method disableAutomaticInteractionDetection: and passing true as a parameter, as shown below:

// Swift
One.disableAutomaticInteractionDetection(true)
// https://github.com/thunderheadone/one-sdk-ios#disable-automatic-interaction-detection
// Kotlin
oneConfigureCodelessInteractionTracking {
    // disables Fragment/Activity Interaction Tracking
    disableCodelessInteractionTracking = true 
}
// https://github.com/thunderheadone/one-sdk-android#disable-automatic-interaction-detection

An appropriate place to call the method might be under didFinishLaunchingWithOptions in your AppDelegate for iOS or under onCreate in your Application class for Android.

You can set this back to false at any point to restart automatic Interaction detection.

Usage

Initialization

To initialize the ONE Flutter Plugin, call the following method:

import 'package:one_sdk_flutter/one_sdk_flutter.dart';

One.initializeOne(SITE_KEY, TOUCHPOINT, API_KEY, SHARED_SECRET, USER_ID, HOST, false);
  • See example of usage here

Send an Interaction

To send an Interaction request without properties, call the following method:

One.sendInteraction("/interactionPath", null);
  • See example of usage here

To send an Interaction request with properties, call the following method:

One.sendInteraction("/interactionPath", { 'key' : 'value' });
  • See example of usage here

Access debug information

To configure logging, call the following method:

One.setThunderheadLogLevel(true);
  • See example of usage here

Questions or need help

Thunderhead ONE Support

The Thunderhead team is available 24/7 to answer any questions you have. Just email onesupport@thunderhead.com or visit our docs page for more detailed installation and usage information.

Salesforce Interaction Studio Support

For Salesforce Marketing Cloud Interaction Studio questions, please submit a support ticket via https://help.salesforce.com/home

Libraries

one_sdk_flutter