Skip to main content

Installation

Integration Example​

You have a repository available on GitHub with a sample project which contains a working Flutter app integrating the MeetingLawyers iOS and Android SDKs.

For MeetingPros apps (lawyers together with doctors and vets), see MeetingPros below.

How it works​

Flutter apps integrate the native SDKs through a small method channel that you copy into your own project. No Flutter package is needed. The native code is the same MeetingLawyersIntegration file used by the iOS and Android samples, and the channel only translates the calls. The rest of your app has no dependency on the SDK:

FileRole
lib/meeting_lawyers/meeting_lawyers.dartDart API: configure, configureTheme, authenticate, openProfessionalList, openChat, isAuthenticated, logout
ios/Runner/MeetingLawyersChannel.swiftiOS channel and the FlutterNavigationController
ios/Runner/MeetingLawyersIntegration.swiftiOS file that owns the SDK
android/.../MeetingLawyersChannel.ktAndroid channel
android/.../MeetingLawyersIntegration.ktAndroid file that owns the SDK
android/.../MeetingLawyersMessagingService.ktRoutes FCM messages and tokens to the SDK, configuring it from the saved values when a push wakes the app

Requirements​

FlutteriOSAndroidSDKs
3.47+Xcode 26+, iOS 15+Android Studio, JDK 17+, minSdk 24MeetingLawyers iOS 2.2.1 and Android 2.1.15

Ask support@meetinglawyers.com for your SDK API_KEY.

Step 1: Copy the bridge​

Copy the files in the table above into the same paths of your Flutter project. In the Android files, change the package line to your app's package.

Step 2: iOS setup​

  1. Open ios/Runner.xcworkspace and add these Swift Packages (Project > Package Dependencies > +) to the Runner target:
PackageVersionProduct
https://github.com/MeetingLawyers/ios-sdk-spm-meetinglawyersExact 2.2.1MeetingLawyers
https://github.com/firebase/firebase-ios-sdkExact 12.15.0FirebaseMessaging
  1. Embed the FlutterViewController in a navigation controller whose class is FlutterNavigationController (defined in MeetingLawyersChannel.swift), so the SDK screens are pushed over Flutter. In Main.storyboard, select the Flutter view controller and choose Editor > Embed In > Navigation Controller, then set the navigation controller's class to FlutterNavigationController. See the sample's Main.storyboard.

  2. Configure Firebase, start push handling and register the channel in AppDelegate.swift:

ios/Runner/AppDelegate.swift
import FirebaseCore
import Flutter
import UIKit

@main
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let launched = super.application(application, didFinishLaunchingWithOptions: launchOptions)
FirebaseApp.configure()
MeetingLawyersIntegration.shared.startHandlingPushNotifications()
return launched
}

func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "MeetingLawyersChannel") {
MeetingLawyersChannel.register(with: registrar)
}
}
}
  1. Add your GoogleService-Info.plist to the Runner target, and the Push Notifications and Background Modes > Remote notifications capabilities.
  2. Add the camera and microphone usage descriptions to Info.plist, see the iOS access permissions table.

Step 3: Android setup​

  1. Add the MeetingLawyers Maven repository to android/build.gradle.kts. It is public, no credentials needed:
android/build.gradle.kts
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://sdk-download.meetinglawyers.com/android/maven/")
content { includeGroup("com.meetinglawyers") }
}
}
}
  1. Declare the Firebase plugins in android/settings.gradle.kts:
android/settings.gradle.kts
plugins {
id("com.google.gms.google-services") version "4.4.4" apply false
id("com.google.firebase.crashlytics") version "2.9.9" apply false
}
  1. Apply them, set minSdk and add the dependencies in android/app/build.gradle.kts. The SDK pulls in Firebase Crashlytics, so its plugin is required:
android/app/build.gradle.kts
plugins {
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}

android {
defaultConfig {
minSdk = 24
}
}

dependencies {
implementation("com.meetinglawyers:sdk:2.1.15")
implementation(platform("com.google.firebase:firebase-bom:32.7.1"))
implementation("com.google.firebase:firebase-messaging")
}
  1. Register the channel in MainActivity:
android/app/src/main/kotlin/.../MainActivity.kt
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine

class MainActivity : FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MeetingLawyersChannel.register(flutterEngine, this)
}
}
  1. The SDK screens inherit the app theme, so LaunchTheme and NormalTheme must descend from Theme.MaterialComponents:
android/app/src/main/res/values/styles.xml
<style name="LaunchTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- keep your existing items -->
</style>
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- keep your existing items -->
</style>
  1. Declare the messaging service inside <application> in AndroidManifest.xml and add your google-services.json to android/app/:
android/app/src/main/AndroidManifest.xml
<service android:name=".MeetingLawyersMessagingService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

Step 4: Use it from Dart​

import 'meeting_lawyers/meeting_lawyers.dart';

await MeetingLawyers.configure(apiKey: apiKey, isProduction: false);
await MeetingLawyers.configureTheme(0xFF1E5AA8);
await MeetingLawyers.authenticate(userId);
await MeetingLawyers.openProfessionalList();
await MeetingLawyers.openChat(professionalHash);
await MeetingLawyers.logout();
MethodWhat it does
configureConfigures the SDK. isProduction: false uses the demo environment. Call it once at startup
configureThemeApplies your brand color (0xAARRGGBB) to the SDK screens
authenticateSigns the user in, asks for push permission and registers the push token
isAuthenticatedtrue while a user is signed in
openProfessionalListOpens the professional list. Tapping a professional opens its chat
openChatOpens the chat with a professional by professional hash
logoutSigns the user out

Errors from the native side arrive as PlatformException.

Step 5: Push notifications​

Share your Firebase credentials with MeetingLawyers as described for iOS and Android. The bridge already registers the push token and routes the notifications to the SDK.

MeetingPros​

MeetingPros apps offer lawyers (MeetingLawyers SDK) together with doctors and vets (MeetingDoctors SDK). The MeetingPros Flutter sample follows the same steps with a meeting_pros channel over the MeetingProsIntegration files. See MeetingPros for what the integration does. Ask support@meetinglawyers.com for a MeetingLawyers API key and a MeetingDoctors API key.

Files to copy:

FileRole
lib/meeting_pros/meeting_pros.dartDart API: configure, configureTheme, authenticate, openProfessionalList, openLawyerChat, availableFeatures, openFeature, isAuthenticated, logout
ios/Runner/MeetingProsChannel.swiftiOS channel and the FlutterNavigationController
ios/Runner/MeetingProsIntegration.swiftiOS file that owns both SDKs
android/.../MeetingProsChannel.ktAndroid channel
android/.../MeetingProsIntegration.ktAndroid file that owns both SDKs
android/.../MeetingProsMessagingService.ktRoutes FCM messages and tokens to both SDKs

What changes from the steps above:

  • iOS: also add https://github.com/Meeting-Doctors/meetingdoctors-sdk-spm (exact 11.6.3, product MeetingDoctorsSDKWrapper). In AppDelegate.swift use MeetingProsIntegration and MeetingProsChannel instead of the MeetingLawyers ones.
  • Android: also add the MeetingDoctors repository and dependencies:
android/build.gradle.kts
maven { url = uri("https://storage.googleapis.com/production-mobile-sdks/android/") }
android/app/build.gradle.kts
dependencies {
implementation("com.meetingdoctors:customer-chat-sdk:2.9.0")
implementation("com.meetingdoctors:videocall-sdk:3.0.22")
implementation("com.meetingdoctors:meetingdoctors-security-sdk:1.1.0")
}
  • Android: MainActivity must extend FlutterFragmentActivity (the MeetingDoctors lists are fragments) and register MeetingProsChannel. Declare .MeetingProsMessagingService in the manifest.

Use it from Dart:

import 'meeting_pros/meeting_pros.dart';

await MeetingPros.configure(
lawyersApiKey: lawyersApiKey,
doctorsApiKey: doctorsApiKey,
isProduction: false,
);
await MeetingPros.configureTheme(0xFF2E7D6B);
await MeetingPros.authenticate(userId);
await MeetingPros.openProfessionalList(ProfessionalType.lawyers);
await MeetingPros.openLawyerChat(professionalHash);
final features = await MeetingPros.availableFeatures();
await MeetingPros.openFeature(DoctorsFeature.medicalHistory);
await MeetingPros.logout();
MethodWhat it does
configureConfigures both SDKs. isProduction: false uses the MeetingLawyers demo environment and the MeetingDoctors staging one
authenticateSigns the user into both SDKs, asks for push permission and registers the push token
isAuthenticatedtrue only while the user is signed into both SDKs
openProfessionalListOpens the lawyers, doctors or vets list
openLawyerChatOpens the chat with a lawyer by professional hash
availableFeaturesThe MeetingDoctors features your company has: videoCall, medicalHistory, myHealth, booking, appointments. Call it after authenticate
openFeatureOpens one of those features. Fails when the company does not have it
logoutSigns the user out of both SDKs