# Quick Start Guide

 There's a new version available!

These pages cover version 2 of our SDK, but a newer version is available. In general, we suggest that you update to the latest version to take advantage of new features and fixes.

*   Are you new to our SDKs? [Check out the latest docs.](/integrations/sdk/flutter/getting-started)
*   Otherwise, [learn about updating to the latest version](/integrations/sdk/flutter/whats-new/)

Before you can take advantage of our SDK, you need to install and initialize the SDK.

 Our MCP server can help you get started

Our MCP server includes SDK-installation tools that can help you get integrated quickly with Customer.io and troubleshoot any issues you might have. See [Set up an MCP server](/ai/mcp-server/) to get started.

## Setup process overview[](#setup-process-overview)

Flutter lets you build native mobile apps using Dart. Our Flutter SDK helps you integrate Customer.io to `identify` people, `track` their activity, and send both push notifications and in-app messages.

1.  [Install and initialize the SDK.](#install-init)
2.  [Identify and Track](#identify-and-track)
3.  [Push Notifications](#push-notifications)
4.  [In-App](#in-app)

## 1\. Install the SDK[](#install-init)

1.  In your project folder install the `customer_io` package:
    
    ```shell
    flutter pub add customer_io
    ```
    
    This adds a line to your package’s `pubspec.yaml`
    
    ```yaml
    dependencies:
       customer_io: ^4.0.0
    ```
    
2.  Set up your project to support iOS and/or Android:
    
     iOS
    
    #### iOS[](#iOS)
    
    1.  In your terminal, run `pod install --repo-update --project-directory=ios`. This adds the required iOS dependencies to your project. When the process is complete, you’ll see a message like this: `Pod installation complete! There are X dependencies from the Podfile and Y total pods installed.`
    
     Android
    
    #### Android[](#Android)
    
    1.  Go to the Android subfolder and include [google-services-plugin](https://developers.google.com/android/guides/google-services-plugin) by adding the following lines to the project-level `android/build.gradle` file:
        
        ```groovy
        buildscript {
           repositories {
              // Add this line if it isn't already in your build file:
              google()  // Google's Maven repository
           }
        
           dependencies {
              // Add this line:
              classpath 'com.google.gms:google-services:<version-here>'  // Google Services plugin
           }
        }
        
        allprojects {
           repositories {
              // Add this line if it isn't already in your build file:
              google()  // Google's Maven repository
           }
        }
        ```
        
    2.  Add the following line to `android/app/build.gradle`:
        
        ```groovy
        apply plugin: 'com.google.gms.google-services'  // Google Services plugin
        ```
        
    3.  Download `google-services.json` from your Firebase project and copy the file to `android/app/google-services.json`.
        
    
3.  Initialize the SDK:
    
    1.  Add your *CDP API key* and *site ID* to your configuration.
        
        *   **CDP API Key**: You’ll find this key in your [*Flutter* connection](/integrations/sdk/flutter/getting-started/auth/#get-your-cdp-api-key).
        *   **Site ID**: You’ll find this value in your workspace under **[Settings > Workspace Settings > API and webhook credentials](https://fly.customer.io/workspaces/last/settings/api_credentials)**.
    2.  Initialize the SDK in your app. In your `main.dart` file—or wherever you want to initialize the `CustomerIO` plugin—add the code below:
        
        ```dart
         import 'package:customer_io/customer_io.dart';
         import 'package:customer_io/customer_io_config.dart';
         import 'package:customer_io/customer_io_enums.dart';
        
        
         await CustomerIO.initialize(
          config: CustomerIOConfig(
            cdpApiKey: 'cdpApiKey',
            region: Region.us, // Replace with Region.EU if your Customer.io account is in the EU.
            inAppConfig: InAppConfig(siteId: 'siteId'),
          ),
        );
        ```
        
    3.  Run your application to ensure everything is set up correctly.
        

## 2\. Identify and Track[](#identify-and-track)

1.  Identify a user in your app using the `CustomerIO.identify` method. You *must* identify a user before you can send push notifications and personalized in-app messages.
    
    ```dart
    CustomerIO.instance.identify(userId: email, traits: {
    "name": user.displayName,
    "email": user.email,
    "age": user.age,
    });
    ```
    
2.  Track a custom event using the `CustomerIO.track` method. Events help you trigger personalized campaigns and track user activity.
    
    ```dart
    CustomerIO.instance.track(name: "add-to-cart", properties: {"product": "shoes", "price": "29.99"});
    ```
    
3.  Track screen views to trigger in-app messages associated with specific screens.
    
    ```dart
    CustomerIO.instance.screen(title: "screen-name", properties: {"property": "value"});
    ```
    

## 3\. Push Notifications[](#push-notifications)

 iOS

#### iOS[](#iOS)

1.  Set up your push notification credentials in Customer.io: [Upload your Firebase Cloud Messaging server key](https://fly.customer.io/workspaces/last/settings/actions/push/ios) (.json format). Our Flutter SDK uses FCM for both iOS and Android push notifications.
2.  Request push notification permissions from the user. You can do this through [Firebase](https://firebase.google.com/docs/cloud-messaging/flutter/receive) or any other package.
3.  To ensure that metrics are tracked, configure Background Modes. In Xcode, enable “Remote notifications” under Capabilities > Background Modes.

 Android

#### Android[](#Android)

1.  Set up your push notification credentials in Customer.io: [Upload your Firebase Cloud Messaging server key](https://fly.customer.io/workspaces/last/settings/actions/push/android) (.json format).
2.  Request push notification permissions from the user. You can do this through [Firebase](https://firebase.google.com/docs/cloud-messaging/flutter/receive) or any other package.
3.  Ensure that you:
    1.  [Add your Google Firebase Cloud Messaging (FCM) key to Customer.io and enable push notifications for Android](https://docs.customer.io/journeys/push-developer-guide/#fcm-setup). Our Flutter SDK receives push notifications from FCM.
    2.  Add notification icon resources:
        *   Place a notification icon file named `ic_notification.png` in your drawable folders.
        *   Make sure your app’s `AndroidManifest.xml` has the proper FCM permissions.

## 4\. In-App[](#in-app)

1.  To enable in-app messaging, all you need to do is add your site ID. Remember, you’ll find your site ID under **[Data & Integrations > Integrations > Customer.io API: Track](https://fly.customer.io/workspaces/last/settings/api_credentials)** in the *Connections* tab.
    
2.  Ensure that the SDK is initialized with the site ID in your app. You can call the `initialize` method from your components or services:
    
    ```dart
     import 'package:customer_io/customer_io.dart';
     import 'package:customer_io/customer_io_config.dart';
     import 'package:customer_io/customer_io_enums.dart';
    
    
     await CustomerIO.initialize(
     config: CustomerIOConfig(
         cdpApiKey: 'cdpApiKey',
         region: Region.us, // Replace with Region.EU if your Customer.io account is in the EU.
         inAppConfig: InAppConfig(siteId: 'siteId'),
         pushConfig: PushConfig(
         android: PushConfigAndroid(
             pushClickBehavior:
             PushClickBehaviorAndroid.activityPreventRestart,
         ),
         ),
     ),
     );
    ```