mesibo

mesibo is a real-time communication platform for adding end-to-end encrypted messaging, group chat, voice & video calls, and conferencing to mobile and web apps. It is completely free for development, education, and non-commercial use.

Features

  • One-on-one messaging and Group chat
  • High quality voice and video calling and conferencing
  • Rich messaging (text, picture, video, audio, other files)
  • End-to-end Encryption
  • Location sharing
  • Message status and typing indicators
  • Online status (presence) and real-time profile update
  • Push notifications

Installation

Add the package to your app:

flutter pub add mesibo

and import it:

import 'package:mesibo/mesibo.dart';

The mesibo Android and iOS SDKs come with it: there is nothing else to add.

This package was published as mesibo_flutter_sdk before 2.11. That name is kept for existing apps: from 2.12 it installs this package and exports its API, so they get every release. To switch, replace mesibo_flutter_sdk with mesibo in pubspec.yaml and in the imports.

Requirements

  • Flutter 3.44 or later
  • iOS 15 or later. The mesibo iOS SDK comes through Swift Package Manager, which Flutter uses by default; if you turned it off, turn it on with flutter config --enable-swift-package-manager.
  • iOS simulator: arm64 only (a Mac with Apple silicon). To build for all simulators with flutter build ios --simulator, set EXCLUDED_ARCHS[sdk=iphonesimulator*] = x86_64 in your Runner target. flutter run on a simulator works without it.
  • Android: minSdk 24

iOS permissions

Add these to your app's ios/Runner/Info.plist. iOS stops an app that uses the microphone, camera, photos, contacts or location without a description of why:

<key>NSMicrophoneUsageDescription</key>
<string>This app uses the microphone for voice and video calls, and to record voice messages.</string>
<key>NSCameraUsageDescription</key>
<string>This app uses the camera for video calls, and to send pictures and videos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app lets you send pictures and videos from your photo library.</string>
<key>NSContactsUsageDescription</key>
<string>This app syncs the phone numbers in your contacts to find who you can message and call.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses your location when you share it with your contacts.</string>
<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
    <string>voip</string>
    <string>remote-notification</string>
</array>

audio keeps a call going when the app is in the background, voip is for incoming calls (CallKit), and remote-notification for push notifications. Leave out what your app doesn't use, for example contacts or location.

On Android, the mesibo SDK declares its permissions itself, except contacts: to sync phone contacts, add this to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_CONTACTS" />

App ID and user tokens

A mesibo user token works only for the App ID it was created with: the Android package name (applicationId) or the iOS bundle identifier. Create the tokens in the mesibo console with the App ID of the platform the app runs on.

Where to find them in a Flutter project:

Platform App ID Where
Android applicationId android/app/build.gradle (or build.gradle.kts)
iOS Bundle Identifier Xcode: Runner target → General → Identity, or PRODUCT_BUNDLE_IDENTIFIER in ios/Runner.xcodeproj/project.pbxproj

They are often different: flutter create --org com.example my_app gives com.example.my_app on Android and com.example.myApp on iOS. Either create a token for each App ID, or set both to the same ID. At run time, Mesibo.getInstance().getAppIdForAccessToken() returns the App ID to use.

If the token does not match the App ID, the connection status is MESIBO_STATUS_AUTHFAIL.

The example app uses com.mesibo.flutter.example on both Android and iOS, so the same tokens work on both.

Example app

Create two users in the mesibo console with the App ID com.mesibo.flutter.example, and pass their tokens and addresses when you run the example, so that they are not in the source code:

cd example
flutter run --dart-define=USER1_TOKEN=<token> --dart-define=USER1_ADDRESS=<address> \
            --dart-define=USER2_TOKEN=<token> --dart-define=USER2_ADDRESS=<address>

Log in as User-1 on one device and as User-2 on another: each sends messages and calls to the other user's address.

Location picker on Android (optional)

The Android messaging UI supports location picking and rendering using either OpenStreetMap or Google Maps.

To eliminate Google dependencies and ensure compatibility in regions where Google services are unavailable, the UI uses OpenStreetMap by default. No additional configuration is required for this default behavior.

If you prefer to use Google Maps and Google Places instead, add the optional mesibo location picker to android/app/build.gradle:

implementation "com.mesibo.api:locationpicker:2.1.0"

and your Google Maps API key (with the Maps SDK for Android and Places API enabled) to android/app/src/main/AndroidManifest.xml, inside <application>:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="YOUR_API_KEY" />

Once the dependency and API key are added, the location picker will automatically switch to Google Maps without requiring any further code changes.

Using a newer mesibo SDK

The plugin uses the mesibo Android and iOS SDK of its release or later:

  • iOS: newer 2.x releases are used when you update your packages (in Xcode, File → Packages → Update to Latest Package Versions).
  • Android: the latest mesibo release is used automatically (the plugin takes the versions from https://cdn.mesibo.com/android/mesibo.gradle, as the mesibo Android samples do). To use another release, add it to your app's build.gradle, for example implementation "com.mesibo.api:mesibo:2.12.0"; Gradle uses the highest version requested.

Documentation & Tutorials

Libraries

mesibo