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:
| File | Role |
|---|---|
lib/meeting_lawyers/meeting_lawyers.dart | Dart API: configure, configureTheme, authenticate, openProfessionalList, openChat, isAuthenticated, logout |
ios/Runner/MeetingLawyersChannel.swift | iOS channel and the FlutterNavigationController |
ios/Runner/MeetingLawyersIntegration.swift | iOS file that owns the SDK |
android/.../MeetingLawyersChannel.kt | Android channel |
android/.../MeetingLawyersIntegration.kt | Android file that owns the SDK |
android/.../MeetingLawyersMessagingService.kt | Routes FCM messages and tokens to the SDK, configuring it from the saved values when a push wakes the app |
Requirements
| Flutter | iOS | Android | SDKs |
|---|---|---|---|
| 3.47+ | Xcode 26+, iOS 15+ | Android Studio, JDK 17+, minSdk 24 | MeetingLawyers 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
- Open
ios/Runner.xcworkspaceand add these Swift Packages (Project>Package Dependencies>+) to theRunnertarget:
| Package | Version | Product |
|---|---|---|
https://github.com/MeetingLawyers/ios-sdk-spm-meetinglawyers | Exact 2.2.1 | MeetingLawyers |
https://github.com/firebase/firebase-ios-sdk | Exact 12.15.0 | FirebaseMessaging |
-
Embed the
FlutterViewControllerin a navigation controller whose class isFlutterNavigationController(defined inMeetingLawyersChannel.swift), so the SDK screens are pushed over Flutter. InMain.storyboard, select the Flutter view controller and choose Editor > Embed In > Navigation Controller, then set the navigation controller's class toFlutterNavigationController. See the sample'sMain.storyboard. -
Configure Firebase, start push handling and register the channel in
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)
}
}
}
- Add your
GoogleService-Info.plistto theRunnertarget, and the Push Notifications and Background Modes > Remote notifications capabilities. - Add the camera and microphone usage descriptions to
Info.plist, see the iOS access permissions table.
Step 3: Android setup
- Add the MeetingLawyers Maven repository to
android/build.gradle.kts. It is public, no credentials needed:
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://sdk-download.meetinglawyers.com/android/maven/")
content { includeGroup("com.meetinglawyers") }
}
}
}
- Declare the Firebase plugins in
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
}
- Apply them, set
minSdkand add the dependencies inandroid/app/build.gradle.kts. The SDK pulls in Firebase Crashlytics, so its plugin is required:
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")
}
- Register the channel in
MainActivity:
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)
}
}
- The SDK screens inherit the app theme, so
LaunchThemeandNormalThememust descend fromTheme.MaterialComponents:
<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>
- Declare the messaging service inside
<application>inAndroidManifest.xmland add yourgoogle-services.jsontoandroid/app/:
<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();
| Method | What it does |
|---|---|
configure | Configures the SDK. isProduction: false uses the demo environment. Call it once at startup |
configureTheme | Applies your brand color (0xAARRGGBB) to the SDK screens |
authenticate | Signs the user in, asks for push permission and registers the push token |
isAuthenticated | true while a user is signed in |
openProfessionalList | Opens the professional list. Tapping a professional opens its chat |
openChat | Opens the chat with a professional by professional hash |
logout | Signs 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:
| File | Role |
|---|---|
lib/meeting_pros/meeting_pros.dart | Dart API: configure, configureTheme, authenticate, openProfessionalList, openLawyerChat, availableFeatures, openFeature, isAuthenticated, logout |
ios/Runner/MeetingProsChannel.swift | iOS channel and the FlutterNavigationController |
ios/Runner/MeetingProsIntegration.swift | iOS file that owns both SDKs |
android/.../MeetingProsChannel.kt | Android channel |
android/.../MeetingProsIntegration.kt | Android file that owns both SDKs |
android/.../MeetingProsMessagingService.kt | Routes FCM messages and tokens to both SDKs |
What changes from the steps above:
- iOS: also add
https://github.com/Meeting-Doctors/meetingdoctors-sdk-spm(exact11.6.3, productMeetingDoctorsSDKWrapper). InAppDelegate.swiftuseMeetingProsIntegrationandMeetingProsChannelinstead of the MeetingLawyers ones. - Android: also add the MeetingDoctors repository and dependencies:
maven { url = uri("https://storage.googleapis.com/production-mobile-sdks/android/") }
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:
MainActivitymust extendFlutterFragmentActivity(the MeetingDoctors lists are fragments) and registerMeetingProsChannel. Declare.MeetingProsMessagingServicein 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();
| Method | What it does |
|---|---|
configure | Configures both SDKs. isProduction: false uses the MeetingLawyers demo environment and the MeetingDoctors staging one |
authenticate | Signs the user into both SDKs, asks for push permission and registers the push token |
isAuthenticated | true only while the user is signed into both SDKs |
openProfessionalList | Opens the lawyers, doctors or vets list |
openLawyerChat | Opens the chat with a lawyer by professional hash |
availableFeatures | The MeetingDoctors features your company has: videoCall, medicalHistory, myHealth, booking, appointments. Call it after authenticate |
openFeature | Opens one of those features. Fails when the company does not have it |
logout | Signs the user out of both SDKs |