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. Configure App Inbox
  • 2. App Inbox APIs
  1. Hybrid Apps
  2. Flutter

App Inbox Messaging

Send targeted push notifications to your Flutter app users with Antsomi SDK. Rich media support & iOS/Android integration guide.

PreviousPush MessagingNextApp In-line Content

Last updated 12 months ago

Antsomi App Inbox Messaging feature allows you to engage and communicate with your users effectively through notifications within your mobile application. App Inbox messages provide a seamless way to deliver timely and personalized information to your users. With this feature, you can enhance user engagement, promote important updates, and tailor your communication based on user behavior and preferences.

Before continuing, please ensure that you've

1. Configure App Inbox

In your main(), after invoking the config() method of AntsomiSDK, you can init the app inbox by following:

antsomiSdk.appInboxInit(destinationID: '8317604', audienceType: 'visitor');

To effectively configure Antsomi App Inbox Messaging, you'll need to define two essential parameters: destinationId and audienceType. The table below provides a quick overview of each parameter and its purpose.

Field
Data Type
Description

destinationID

String

A unique identifier specifying the message destination.

For example, 8317604.

audienceType

Enum Value:

  • customers

  • users

A classification parameter for targeted messaging. Each destinationID can target one audieneceType only.

If you don't know how to get your DESTINATION_ID, refer to this document

2. App Inbox APIs

After configuring the Antsomi App Inbox, you're ready to harness the power of the following APIs to manage and deliver messages effectively. These APIs empower you to organize messages into categories, retrieve messages, access specific messages by their unique identifiers, and control message statuses, enhancing your ability to engage with users through the App Inbox.

Get a List of Message Categories

When App Inbox messages are delivered via CDP365, they are categorized into one or multiple catalogs based on their content and relevance. This API allows you to retrieve these categorized catalogs, efficiently organizing and presenting messages to users, enhancing their overall messaging experience within your mobile app.

To retrieve a list of message categories, you can use the following function:

import 'package:antsomisdk/antsomi.dart'; // Contains Antsomi SDK APIs
import 'package:antsomisdk/catalog.dart'; // Contains the Catalog class

// Initialize AntsomiSDK object
antsomiSdk = Antsomi();
List<Catalog> catalog = await antsomiSdk.getAllLabels();

The Catalog object is a structured data container that represents a message category within the Antsomi App Inbox. Here's a brief description of the key attributes within the Catalog object:

Field
Data Type
Description

catalogID

String

A unique identifier for the message category.

catalogName

String

The name or title of the category.

To illustrate, look at the sample result below, showcasing a list of Catalogs retrieved from the API. In a real app scenario, this information is typically presented to users on a mobile app screen, ensuring seamless message organization and access.

Get a List of Messages

The 'Get List Messages' API allows you to retrieve a comprehensive list of messages within your Antsomi App Inbox.

To retrieve a list of messages, you can use the following function:

import 'package:antsomisdk/antsomi.dart'; // Contains Antsomi SDK APIs
import 'package:antsomisdk/inbox_items.dart'; // Contains the InboxItem class

// Initialize AntsomiSDK object
antsomiSdk = Antsomi();

// Configure the number of messages returned by the API, default is 5
antsomiSdk.setPageLimit(limit: 20);

// Get a list of messages
List<InboxItem> messages = await antsomiSdk.getMessage();
// Get a list of messages by Category ID
List<InboxItem> messages = await antsomiSdk.getMessage(catalogID: _filterCatalogID);

The InboxItemobject is a structured data container that represents a message category within the Antsomi App Inbox. Here's a brief description of the key attributes within the InboxItem object:

Field
Data Type
Description

itemId

String

The unique ID of each message.

buttonLabel1

String

The label of the first button is associated with the message.

buttonAppUrl1

String

The URL or action associated with the first button can lead to a specific destination or action when clicked.

buttonLabel2

String

The label of the second button associated with the message (if applicable).

buttonAppUrl2

String

The URL or action associated with the second button can lead to a specific destination or action when clicked (if applicable).

imageUrl

String

The URL of the message's cover image.

heading

String

The heading or title of the message.

content

String

The text content of the message.

templateId

String

The ID of the message template. Messages can fall into one of three templates:

  • announcements with no buttons

  • coupon with one button

  • order_verified with two buttons

catalogIds

List<String>

A list of Category IDs to which this message has been categorized.

status

Number

The status of the message, where:

  • 1 represents unread

  • 2 represents read

dateCreated

DateTime

The timestamp indicates when the message was created.

lastUpdated

DateTime

The timestamp indicates the most recent update to the message.

expireDate

DateTime

The timestamp indicates when the message is set to expire.

To provide a visual representation of the 'Get List Messages' API's functionality, consider the examples below. The first illustrates a list of messages retrieved from the API without any filtering. In contrast, the second example demonstrates the API's advanced filtering capabilities, resulting in a tailored list of messages associated with specific catalogs.

Get a Message by ID

The 'Get a Message by ID' API serves as a valuable tool to retrieve a specific message from your Antsomi App Inbox. By supplying the unique identifier of the desired message, you can access its content and details with ease.

To retrieve a message using its ID, you can use the following function:

import 'package:antsomisdk/antsomi.dart'; // Contains Antsomi SDK APIs
import 'package:antsomisdk/inbox_items.dart'; // Contains the InboxItem class

// Initialize AntsomiSDK object
antsomiSdk = Antsomi();

// Get a message
InboxItem message = await antsomiSdk.getMessageByID(messageID: _messageID);

To illustrate this API's functionality, refer to the example below, showcasing a retrieved message based on its unique ID.

Change a Message status

With the 'Update Message Status' API, you can toggle a message's status between read and unread, allowing for precise control over how messages are presented to users.

To modify a message status, simply call this function:

import 'package:antsomisdk/antsomi.dart'; // Contains Antsomi SDK APIs
import 'package:antsomisdk/modify_action.dart'; // Contains the ActionType enum

// Initialize AntsomiSDK object
antsomiSdk = Antsomi();

// Update a message status to 'read'
await antsomiSdk.modifyAction(messageID: _messageID, action: ActionType.read);

To illustrate the functionality of this API, please refer to the example below, which showcases the process of updating a message's status from read(without the blue dot indicator) to unread(with the blue dot indicator) or vice versa.

Incorporate Antsomi's App Inbox Messaging to elevate your mobile app's communication strategy. With powerful APIs and customization options, you can deliver personalized, engaging messages tailored to your users' preferences.

This API can be further customized with a filter parameter, which accepts a list of catalog IDs obtained from the previous API.

Get List of Message Categories
.
added the Flutter SDK to your app
Sample Result - List of Catalogs Retrieved from the API
Sample Result: List of Messages (Without Filtering)
Sample Result: List of Messages (With Filtering)
Sample Result: Message Retrieved by ID
Sample Result: Message Status Updated (Read to Unread or Vice Versa)