Skip to main content
This guide will help you install and set up the Linkrunner SDK in your Flutter application.

Requirements

  • Flutter 3.19.0 or higher
  • Dart 3.3.0 or higher
  • iOS 15.0+ / Android 5.0 (API level 21) and above

Installation

Step 1: Add the Package

Run the following command to add the latest version of the Linkrunner package to your project:
flutter pub add linkrunner
This command will automatically:
  • Add the latest version of linkrunner to your pubspec.yaml
  • Download and install the package and its dependencies

Step 2: Platform Specific Setup

Android Configuration

  1. Ensure your project’s minSdkVersion is at least 21 in your android/app/build.gradle file:
android {
    defaultConfig {
        minSdkVersion 21
        // other config...
    }
}
  1. Add the following permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Note: The AD_ID permission (<uses-permission android:name="com.google.android.gms.permission.AD_ID" />) is already included in the SDK and is required for collecting device identifiers (GAID). If your app participates in Designed for Families, you should revoke AAID and disable AAID collection. See the Disabling AAID Collection section in the usage guide for more details.

Revoking the AD_ID Permission

According to Google’s Policy, apps that target children must not transmit the Advertising ID. To revoke the AD_ID permission, use Flutter SDK version 3.5.0 and above. Children apps targeting Android 13 (API 33) and above must prevent the permission from getting merged into their app by adding a revoke declaration to their Manifest. Use the setDisableAaidCollection() and isAaidCollectionDisabled() functions to disable AAID collection programmatically: android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- Remove AD_ID permission that comes from the SDK -->
    <uses-permission 
        android:name="com.google.android.gms.permission.AD_ID" 
        tools:node="remove" />

    <!-- Your other permissions -->
</manifest>
Make sure to add xmlns:tools="http://schemas.android.com/tools" to your manifest tag to use the tools:node="remove" attribute. If you disable AAID collection, you should also remove the AD_ID permission from your manifest to fully comply with Google Play’s Family Policy requirements.
For more information, see Google Play Services documentation.
  1. Backup Configuration
For Android apps, the SDK provides backup rules to exclude Shared Preferences data from backup. This prevents the retention of the Linkrunner install ID during reinstallation, ensuring accurate detection of new installs and re-installs. For detailed backup configuration instructions, please refer to the Android SDK Backup Configuration.

iOS Configuration

  1. Update your iOS deployment target to iOS 15.0 or higher in your ios/Podfile:
platform :ios, '15.0'
  1. Add the following to your Info.plist file for App Tracking Transparency:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads and improve your app experience.</string>

Next Steps

After installation, proceed to the Usage Guide to learn how to initialize and use the Linkrunner SDK in your Flutter application.