Guides

How to add support chat to a Flutter app

Add in-app support chat to a Flutter app on iOS and Android: install the package, start it, add a chat button, tell it who your users are and verify them.

By The agent44 team

On this page

This guide adds a support chat to a Flutter app with agent44’s Dart package: a chat with your team and an AI agent, a help center, and the device and app version on every conversation. It takes one package, about twenty lines of Dart and one function on your server.

Before you start

  • Flutter 3.38.1 or newer, with the app targeting Android API 24 and iOS 15 or newer.
  • An agent44 workspace. In Settings › Apps, add your app once for iOS and once for Android, and create an SDK key for each. A key starts with a44_pub_ and is shown once.

1. Install the package

Terminal
flutter pub add agent44

Two platform settings are easy to miss. On iOS, add a photo library description to Info.plist so people can attach photos. On Android, make sure the INTERNET permission is in your main AndroidManifest.xml: Flutter’s template adds it to debug builds only, so without it everything works in debug and nothing loads in release.

android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>

2. Start the SDK

main.dart
import 'package:agent44/agent44.dart';
import 'package:flutter/material.dart';

final navigatorKey = GlobalKey<NavigatorState>();

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Agent44.configure(
    publicKeyIos: 'a44_pub_YOUR_IOS_KEY',
    publicKeyAndroid: 'a44_pub_YOUR_ANDROID_KEY',
    navigatorKey: navigatorKey,
  );

  runApp(MaterialApp(
    navigatorKey: navigatorKey, // the same key as above
    home: const HomeScreen(),
  ));
}

The navigatorKey lets the SDK open the chat from a notification and show in-app messages. If you use a router such as go_router, give the router the same key.

3. Add a chat button

Any screen
Scaffold(
  floatingActionButton: const Agent44Launcher(),
  floatingActionButtonLocation: Agent44Launcher.location, // left or right, as set in agent44
  body: …,
)

The launcher shows the unread count and opens the chat. To open it from your own button instead, call Agent44.openChat(context).

A conversation in the Flutter SDK: the user’s messages, an AI agent’s answer with a help article, and a teammate’s reply.
A conversation in the Flutter SDK, with demo data.

Run the app, tap the button and send a message. It appears in your agent44 inbox with the platform, app version, OS and device attached.

4. Tell agent44 who your users are

After sign-in
await Agent44.identify(Agent44User(
  userId: user.id,       // your app's own user id
  email: user.email,     // everything else is optional
  name: user.name,
  signature: user.agent44Hash, // from your server, see the next step
));

People can chat before they sign in. Their conversations move to their account when you call identify, and they see the same history on every device. Call Agent44.logout() when they sign out.

5. Verify your users

Sign the user’s ID on your server. New agent44 workspaces start with identity verification enforced, so a signed-in user is refused until your server signs their ID with the workspace secret (HMAC-SHA256, as lowercase hex). People who haven’t signed in can chat without it.

Node, on your server
crypto.createHmac('sha256', process.env.AGENT44_IDENTITY_SECRET).update(user.id).digest('hex');

Generate the secret in Settings › Identity verification, keep it on your server only, and return the signature to the app when it signs in. Use IDs that can’t be guessed: a database ID or a UUID, not an email address.

What else the same package opens

  • Agent44.showHelpCenter(context): your help center, inside the app.
  • Agent44.showAskAi(context): a question to the AI, answered from your articles.
  • Agent44.showMessenger(context): home, messages, help and updates in one place.
  • Agent44.showChangelog(context): what’s new.

Update prompts need no code at all: create a force update or a What’s New prompt in agent44 and the SDK shows it when the app opens.

Before you release

  • Test a release build on Android, not only debug, to catch the missing INTERNET permission.
  • Fill in the App Store privacy labels and Google Play’s Data safety form. The package’s README lists what the SDK collects.
  • Set up push notifications if you want people told about replies while the app is closed. Without them, a reply is emailed to users with an address after five minutes unread.

The full reference is the Flutter SDK page and the package’s README on GitHub.

More apps.
Not more support staff.

Start free on your first app, and add brands to the same plan as your studio grows.