Developer Guide
API GuideDeveloper Guide
  • Overview
    • Getting Started
    • Customers and Visitors
    • Events and Business Objects (BOs)
      • Sample Event Templates
  • Website
    • Getting Started
      • Direct JS Implementation
      • JS Integration via GTM
      • Tracking Haravan website events
    • Tracking Users
    • Tracking Events
      • [Direct] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
      • [GTM] Sample E-Commerce Events
        • View Product
        • Add a Product to the Shopping Cart
        • View the Shopping Cart
        • Remove a Product from the Shopping Cart
        • Search for Product(s)
        • Checkout Shopping Cart
        • Apply Promotion Code
        • Purchase Product(s)
    • Web Push
  • Android
    • Getting Started
    • Tracking Users
    • Tracking Events
    • Push Messaging
    • App Inbox Messaging
  • iOS
    • Getting Started
      • Integration of Antsomi iOS SDK
    • Tracking Users
    • Tracking Events
    • Push Messaging
  • Hybrid Apps
    • React Native
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Apply Promotion Code
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
    • Flutter
      • Tracking Users
      • Tracking Events
        • Sample E-Commerce Events
          • View Product
          • Add a Product to the Shopping Cart
          • View the Shopping Cart
          • Remove a Product from the Shopping Cart
          • Search for Product(s)
          • Checkout Shopping Cart
          • Purchase Product(s)
      • Push Messaging
      • App Inbox Messaging
      • App In-line Content
  • Antsomi Service Integrations
    • Media Template
    • Media JSON
      • Sample E-Commerce Events
        • Search for Product(s)
        • View Product
        • Add a Product to the Shopping Cart
        • Checkout Shopping Cart
        • Purchase Product(s)
      • Sample User Events
        • Sign-in
        • Sign-up
      • Sample Opt-in Events
        • Subscribe to Email marketing
        • Subscribe to OneSignal channel
  • 3rd Party Integrations
    • Shopify
      • Tracking Shopify website events
    • LINE
      • Integrating LINE Login with your web app
    • Google Ad Manager
      • Targeting CDP365 segment via PPID(s)
Powered by GitBook
On this page
  • 1. Installation
  • 2. Antsomi Instance Initialization
  1. Hybrid Apps

Flutter

Build cross-platform apps (Android, iOS, Web) with Flutter. Integrate Antsomi SDK for in-app personalization & user insights.

PreviousApp Inbox MessagingNextTracking Users

Last updated 11 months ago

stands as an innovative open-source UI software development kit, thoughtfully crafted by Google. With Flutter, you have the ability to create applications that span across diverse platforms, such as Android, iOS, Linux, Mac, Windows, Google Fuchsia, and the web, all while working from a single, cohesive codebase.

Our Antsomi Flutter Mobile SDK is expertly designed to seamlessly harmonize with the latest iterations of both Android and iOS, offering you a powerful solution for building engaging cross-platform applications.

Here's how you can integrate the Antsomi SDK with your Flutter apps:

1. Installation

Step 1: Add the antsomisdk plugin in your pubspec.yaml file.

pubspec.yaml
dependencies:
  antsomisdk: 0.0.32

Antsomi SDK only supports Dart SDK 3.0 and above.

Step 2: Run flutter packages get to install the SDK.

2. Antsomi Instance Initialization

Step 1: Initialize Antsomi in main.dart in main().

main.dart
import 'package:antsomisdk/antsomi.dart';

void main() {
  antsomiSdk = Antsomi();
}

Step 2: Provide the Antsomi instance with your portal config.

main.dart
antsomiSdk.config(
  appGroupId: 'group.antsomi.mstore',
  portalId: '564890637',
  propsId: '564993464',
  applicationID: 'e4e8d06e-4d97-43df-93e8-c36238147ca0',
);

In which:

Key
Description

appGroupId

Your iOS App Group ID.

For example, group.antsomi.mstore

portalId

Your CDP365 Portal ID. For example, 564890637

propsId

Your CDP365 Event Source ID. For example, 564993464

applicationID

Your CDP365 Application ID. For example, e4e8d06e-4d97-43df-93e8-c36238147ca0

Remember to verify the user's mobile device operating system to ensure accurate event source configuration. In CDP365, mobile app event sources are categorized into iOS and Android sources, so it's essential to distinguish between them based on the user's device OS.

Finally, your setting will be similar to the code snippet below:

main.dart
import 'dart:io' show Platform;
import 'package:antsomisdk/antsomi.dart';

void main() {
  antsomiSdk = Antsomi();
  
  if (Platform.isAndroid) {
    antsomiSdk .config(
        appGroupId: 'group.antsomi.mstore',
        portalId: '564890637',
        propsId: '564993464',
        applicationID: 'e4e8d06e-4d97-43df-93e8-c36238147ca0',
    );
  } else {
    antsomiSdk.config(
        appGroupId: 'group.antsomi.mstore',
        portalId: '564890637',
        propsId: '564993465',
        applicationID: 'e4e8d06e-4d97-43df-93e8-c36238147ca0',
    );
  }
}

NEXT STEP

If you haven't had your CDP365 Application ID, please follow this .

Flutter
instruction
Tracking User Attributes
Tracking User Events
Configure Push Messaging
Configure App Inbox Messaging
Implementing App In-line Content