Run Reference App

Run the reference app locally to explore and learn more about Meeting Place.

The Meeting Place Reference App is a sample Flutter application. It shows how to use the Affinidi Meeting Place SDK to build secure, private, and trusted messaging apps. It demonstrates key features such as privacy-preserving user discovery and decentralised communication using the DIDComm v2.1 protocol.

Meeting Place App

Preview of Affinidi Meeting Place Reference App

By running this app locally, you can explore Meeting Place features and learn how to integrate them into your own Flutter projects.

1. Set Up Backend Services

Before you start, set up the backend services required for the reference app.

1.1 Deploy DIDComm Mediator

The Meeting Place app requires a DIDComm Mediator to process messages sent and received by users. The mediator uses the DIDComm v2.1 protocol.

You can deploy the DIDComm Mediator in different ways. In this guide, we use local deployment with the open-source version.

  Deploy the Open-Sourced Mediator locally

  Explore DIDComm Mediator deployment options

The setup generates the mediator DID. Use this to populate the DEFAULT_MEDIATOR_DID environment variable in the app.

1.2 Deploy Control Plane API

The Control Plane API publishes connection offers (invitations) and establishes secure channels for private communication using DIDs.

You can deploy the Control Plane API in various ways. In this guide, we use local deployment with the open-source version.

  Deploy the Open-Sourced Control Plane API locally

  Explore Control Plane API deployment options

Copy the Control Plane DID from the API server and use it to populate the CONTROL_PLANE_DID environmen variable in the app.

2. Set Up Development Environment

After configuring the DIDComm Mediator and Control Plane API, set up the Flutter app locally and run it on a simulator.

2.1. Clone Reference App Repo

Clone the Affinidi Meeting Place Reference App for Flutter locally using the following command.

git clone git@github.com:affinidi/affinidi-meetingplace-reference-app.git

2.2. Setup Environment Tools

Install the tools needed to run the reference app locally.

  1. Install the FVM package for Flutter version management. Currently using Flutter 3.35.3 for this project.
brew tap leoafarias/fvm brew install fvm

Refer to the FVM installation page to set up for other platforms.

  1. Add the fvm in the $PATH for Flutter.

The command below assumes you are using ZSH.

echo '# Setup Flutter path' >> ~/.zshrc echo 'export PATH="$HOME/fvm/default/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
  1. Install jenv package to manage Java version for the reference app. The reference app uses Java 17.

The command below assumes you are using ZSH.

brew install jenv echo '# Load jenv' >> ~/.zshrc echo 'eval "$(jenv init -)"' >> ~/.zshrc source ~/.zshrc
  1. Install Java 17 on your machine if not yet installed.
brew install openjdk@17 jenv add /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/

3. Set Up Reference App

Follow these steps to configure the app, including Firebase and environment variables.

3.1 Configure Environment Variables

Most environment variables have default values. Modify them for your setup or override defaults.

The following variables must be added to your configurations/.env file.

3.1.1 Connect to Control Plane API

Integrate with the Control Plane API to manage connection offers (invitations) and secure channels.

# Required for MeetingPlaceCoreSDK functionality # Control Plane DID CONTROL_PLANE_DID=""

To create an instance of Control Plane API locally, follow the guide from the Control Plane API deployment options. After setting up the API server, copy the CONTROL_PLANE_DID containing the did:web value from the env file.

The did:web value can differ depending on your domain hosting the Control Plane API.

3.1.2 Connect to DIDComm Mediator

Integrate with the DIDComm Mediator for messaging and out-of-band invitations.

# Required for MPX SDK core functionality # Your Mediator DID DEFAULT_MEDIATOR_DID=""

To create an instance of DIDComm Mediator locally, follow the guide from the DIDComm Mediator deployment options. When setting up, the mediator generates a DID that you can use to populate the DEFAULT_MEDIATOR_DID env variable.

3.1.3 Enable Push Notifications

Integrate with Firebase to enable push notifications.

# Required for Firebase integration FIREBASE_IOS_APIKEY="" FIREBASE_IOS_APP_ID="" FIREBASE_MESSAGING_SENDER_ID="" FIREBASE_PROJECT_ID="" FIREBASE_STORAGE_BUCKET="" FIREBASE_IOS_BUNDLE_ID="" FIREBASE_ANDROID_APIKEY="" FIREBASE_ANDROID_APP_ID=""

3.1.4 Optional Environment Variables

These variables have default values but can be customised:

# App configuration (defaults shown) APP_VERSION_NAME="" # Default: "" BIOMETRICS_ENABLED="true" # Default: true DATABASE_LOGGING_ENABLED="false" # Default: false (debug mode only) FOREGROUND_NOTIFICATIONS_ENABLED="false" # Default: false TAPS_TO_UNLOCK_DEBUG="7" # Default: 7 # Chat settings (defaults shown) CHAT_ACTIVITY_EXPIRES_IN_SECONDS="3" # Default: 3 CHAT_PRESENCE_SEND_INTERVAL_IN_SECONDS="60" # Default: 60 CHAT_IMAGE_MAX_SIZE="800" # Default: 800 CHAT_IMAGE_QUALITY_PERCENT="80" # Default: 80 # Profile settings (defaults shown) PROFILE_IMAGE_MAX_SIZE="100" # Default: 100 PROFILE_IMAGE_QUALITY_PERCENT="80" # Default: 80 # Marketplace MARKETPLACE_QR_PREFIX="" # Default: ""

3.2 Firebase Configuration Files

Set up a Firebase project and download the configuration files for iOS and Android.

  1. Refer to the iOS Firebase setup page to generate the GoogleService-Info.plist and place it in the folder ios/Runner.

  2. Refer to the Android Firebase setup page to generate the google-services.json and place it in the folder android/app

3.3 Install Melos Package

Install melos package globally to manage packages for the reference app.

  1. Install Melos package globally and add it to the system $PATH.
dart pub global activate melos && export PATH="$PATH":"$HOME/.pub-cache/bin"
  1. Install Reference App Dependencies
melos pubget
  1. Generate Models and Localised Strings

To generate models and localised strings from arb files, run the following command in your terminal:

melos gen && melos strings

4. Run Reference App

To run the app, use this command in your terminal:

cd app flutter run

If multiple devices are available, you may need to choose one.

4.1 Run App on Simulator

Refer to Flutter’s platform integration to setup Android and iOS environments to run the Flutter application on simulators.

4.2 VSCode Configuration

If you use VS Code, set up your launch configuration:

  1. Copy the template file from /templates/.example.launch.json into the .vscode directory
mkdir -p .vscode && cp templates/.example.launch.json .vscode/launch.json

This configuration points to the correct environment file. You can customise it to add device IDs, change environment files, or extend it for your needs.

5. Explore the Reference App

Once you’ve launched the Meeting Place Reference App locally, explore its core features:

  1. Create an Identity – Generate one or more decentralised identities to connect with other users. Switch identities based on context.

  2. Publish an Invitation – Make yourself discoverable by publishing an invitation for direct or group chats.

  3. Start Messaging – Engage in private, trusted conversations powered by Affinidi Meeting Place.

What’s Next

  Learn more about Affinidi Messaging

  Build trusted messaging app with Affinidi Meeting Place SDK

  Explore different deployment options of DIDComm Mediator