Support Home > SDK Integration > Flutter – SDK Integration

Flutter – SDK Integration


The Kochava Flutter SDK is a lightweight plugin which can be easily integrated into your Flutter project. The entire integration process takes less than five minutes and simply requires adding the SDK within your project and then starting the Kochava Tracker in code. If you have already integrated the SDK and started the tracker, please visit Using the SDK and choose a topic.


Integrating the SDK

Requirements:

  • Android API 16
  • Xcode 11.3.1

 

Supported Platforms:

  • Android
  • iOS

Integration:

Estimated Time to Complete
5 Minutes
  1. Add the SDK.
  2. In order to use the Kochava SDK, first add it within your project. This can be accomplished using pub.dev (recommended) or by downloading the SDK files manually and adding them.

     

    Release Notes —

    Latest Release Notes

     


    •  

      Add the Kochava Tracker plugin to your pubspec.yaml file. Replace “x.y.z” with the latest version obtained from the Download Badge above.

      1. Download the kochava_tracker.zip from the Download Badge above.
      2. Extract the zip file into the root directory of your project.
      3. Add the Kochava Tracker plugin to your pubspec.yaml file.

     

  3. Platform Specific Steps
  4. Dependencies are added alongside the Kochava SDK in your module level build.gradle file.

    Dependencies:

    Dependencies are added in your android/app/build.gradle file.

     

    Google Play Store —

    If you wish for the SDK to collect the Google Play Ads Identifier (ADID) and/or make use of the Install Referrer, you must integrate Google Play Services and add the appropriate dependencies.

     

    Huawei App Gallery —

    If you wish for the SDK to collect the Huawei Advertising ID (OAID) and/or make use of the Install Referrer, you must integrate the Huawei Ads SDK and add the appropriate dependencies.

     

    Permissions:

    Permissions are added to the top level of the android/app/src/main/AndroidManifest.xml file. If an automatically included permission is unwanted it can be removed using the tools:node=”remove” feature.

    NOTE: Ensure you are compliant with the terms and requirements of the publishing app store regarding sensitive permissions such as GET_ACCOUNTS.


Starting the Tracker

Estimated Time to Complete
1 Minute

Once you have added the Kochava SDK to your project, the next step is to configure and start the Kochava Tracker in code. Only your App GUID is required to start the tracker with the default settings, which is the case for typical integrations.

We recommend starting the tracker as soon as the application starts, although this can be done later if needed. Starting the tracker as early as possible will provide more accurate session reporting and help to ensure the tracker has been started before using it. Keep in mind the tracker can only be configured and started once per launch.

 

SDK WAYPOINT: At this point basic integration is complete and the Kochava SDK will begin reporting session activity and attributing installs.

 

Now that you have completed integration you are ready to utilize the many features offered by the Kochava SDK. Continue on to Using the SDK and choose a topic.


Custom Tracker Configuration

If you would like to make adjustments to the tracker configuration beyond the default settings, set your App GUID and the desired parameters and then pass it to the tracker’s configure method.

 

Using a Custom Configuration:

NOTE: Setting values within a configuration object will have no effect after the tracker has been started.

Below is a list of all configuration options and their default settings. Keep in mind that in a typical integration these configuration settings should not be adjusted from their default values.


Below is a list of all configuration options and their default settings. Keep in mind that in a typical integration these configuration settings should not be adjusted from their default values.

Default — None

This string should be set to your Kochava App GUID, which can be found in your Edit App page within the Kochava dashboard. This value is always required (unless a Partner Name is set).

Default — None

Provide an attribution event listener if you wish to be notified of attribution results from Kochava servers. This is not necessary unless you wish to parse the attribution results for use within the app.

For complete details and examples, see: Retrieving Attribution

Default — LOG_LEVEL_ENUM_INFO_VALUE

Set this value to the desired Log Level to be used by the SDK for debugging purposes.

For complete details and examples, see: Enabling Logging

Default — False

If you wish to limit ad tracking at the application level, with respect to Kochava conversions, set this value to true. It can also be toggled after starting the tracker.

For complete details and examples, see: App Limit Ad Tracking

Default — None

This is a reserved setting and should not be set unless provided by your Client Success Manager.

Default — None

This is a reserved value and should not be set unless provided by your Client Success Manager.