Installation
This integration replaces the discontinued Cordova plugin. If you were using it, migrate to this Capacitor-based approach.
Integration Example
You have a repository available on GitHub with a sample project which contains a working Ionic + Capacitor app integrating the MeetingLawyers iOS and Android SDKs.
For MeetingPros apps (lawyers together with doctors and vets), see MeetingPros below.
How it works
Capacitor apps integrate the native SDKs through a small local Capacitor plugin that you copy into your
own project. No npm package is needed. The native code is the same MeetingLawyersIntegration file used by
the iOS and
Android samples, and the plugin only
translates the calls. The rest of your app has no dependency on the SDK:
| File | Role |
|---|---|
src/plugins/meeting-lawyers/ | TypeScript API (definitions.ts and index.ts): configure, configureTheme, authenticate, openProfessionalList, openChat, isAuthenticated, logout |
ios/App/App/MeetingLawyersPlugin.swift | iOS plugin |
ios/App/App/MeetingLawyersIntegration.swift | iOS file that owns the SDK |
ios/App/App/MyViewController.swift | Bridge view controller: registers the plugin and hides the navigation bar over the web view |
android/.../MeetingLawyersPlugin.kt | Android plugin |
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
| Capacitor | Node | iOS | Android | SDKs |
|---|---|---|---|---|
| 8+ | 22+ | Xcode 26+, iOS 15+ | Android Studio, JDK 21, minSdk 24 | MeetingLawyers iOS 2.2.1 and Android 2.1.16 |
Ask support@meetinglawyers.com for your SDK API_KEY.
Step 1: Copy the plugin
Copy the files in the table above into the same paths of your Capacitor project. In the Android files, change
the package line to your app's package.
Step 2: iOS setup
- Open
ios/App/App.xcodeprojand add these Swift Packages (Project>Package Dependencies>+) to theApptarget:
| 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 bridge view controller in a navigation controller, so the SDK screens are pushed over the web view. In
Main.storyboard, set the bridge view controller's class toMyViewController, then choose Editor > Embed In > Navigation Controller. See the sample'sMain.storyboard. -
Configure Firebase and start push handling in
AppDelegate.swift:
import Capacitor
import FirebaseCore
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
MeetingLawyersIntegration.shared.startHandlingPushNotifications()
return true
}
// Keep Capacitor's URL and universal link handling from the template
func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return ApplicationDelegateProxy.shared.application(application, continue: userActivity,
restorationHandler: restorationHandler)
}
}
- Add your
GoogleService-Info.plistto theApptarget, 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 Kotlin and Firebase Gradle plugins and the MeetingLawyers Maven repository to
android/build.gradle. The repository is public, no credentials needed:
buildscript {
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21'
classpath 'com.google.gms:google-services:4.4.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://sdk-download.meetinglawyers.com/android/maven/"
content { includeGroup "com.meetinglawyers" }
}
}
}
- Apply the plugins and add the dependencies in
android/app/build.gradle. The SDK pulls in Firebase Crashlytics, so its plugin is required or the app crashes on launch with "The Crashlytics build ID is missing":
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
kotlinOptions {
jvmTarget = '21'
}
}
dependencies {
implementation "com.meetinglawyers:sdk:2.1.16"
implementation platform("com.google.firebase:firebase-bom:32.7.1")
implementation "com.google.firebase:firebase-messaging"
}
- Register the plugin in
MainActivity:
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
registerPlugin(MeetingLawyersPlugin.class);
super.onCreate(savedInstanceState);
}
}
- 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>
- Keep the SDK session on the device: set
android:allowBackup="false"on<application>and pointandroid:dataExtractionRulesto rules that exclude everything, like the sample'sdata_extraction_rules.xml.
Step 4: Use it from TypeScript
import { MeetingLawyers } from './plugins/meeting-lawyers';
await MeetingLawyers.configure({ apiKey, environment: 'DEV' });
await MeetingLawyers.configureTheme({ primaryColor: '#1E5AA8' });
await MeetingLawyers.authenticate({ userId });
await MeetingLawyers.openProfessionalList();
await MeetingLawyers.openChat({ professionalHash });
await MeetingLawyers.logout();
| Method | What it does |
|---|---|
configure | Configures the SDK. environment: 'DEV' uses the demo environment, the default is 'PROD'. Call it once at startup |
configureTheme | Applies your colors to the SDK screens, see Theme colors |
authenticate | Signs the user in, asks for push permission and registers the push token |
isAuthenticated | Resolves { authenticated }, 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 reject the promise with a readable message.
userId is the user identifier provided by your backend integration, see the
Public API - User documentation.
Theme colors
Every color is optional and is a #RRGGBB or #RRGGBBAA string. The ones you leave out keep the SDK default:
| Option | Where |
|---|---|
primaryColor | Main tint of the SDK screens |
secondaryColor | Accents such as the professional speciality and the unread badge |
navigationBarColor | Navigation bar |
incomingMessageColor | Chat bubbles of the professional |
outgoingMessageColor | Chat bubbles of the user |
For colors only one platform has, see iOS Customization and
Android Customization, and call them from the MeetingLawyersIntegration file.
Step 5: Push notifications
Push works over Firebase Cloud Messaging on both platforms. The code is already in the plugin: authenticate
registers the push token, token refreshes are forwarded and MeetingLawyers pushes go to the SDK. To handle
your own pushes too, see If your app already handles push. What is left
is the Firebase setup:
- Create (or open) your project in the Firebase Console and register
your iOS and Android apps. Their config files are the
GoogleService-Info.plistandgoogle-services.jsonof steps 2 and 3. - iOS: in Project settings > Cloud Messaging, upload your APNs Authentication Key (
.p8) with its Key ID and your Team ID. Without it, no push reaches iOS. - In Project settings > Service accounts, click Generate new private key and send the JSON file to support@meetinglawyers.com. Treat it as a credential: keep it out of source control and send it securely.
Push is not available on every iOS simulator: it needs an Apple Silicon Mac with a recent macOS and Xcode. Otherwise, test it on a device.
If your app already handles push
Only one object receives the push callbacks on each platform, so if your app (or another plugin) already handles push, forward the MeetingLawyers calls from it instead:
- iOS: do not call
startHandlingPushNotifications(). From your ownUNUserNotificationCenterDelegateandMessagingDelegate, call the same methods ofMeetingLawyersIntegration.shared(userNotificationCenterwillPresent/didReceiveandmessaging(_:didReceiveRegistrationToken:)). They pass MeetingLawyers pushes to the SDK and complete any other push the usual way. - Android: do not declare
MeetingLawyersMessagingService. From your ownFirebaseMessagingService:
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
MeetingLawyersPlugin.configureFromSavedArguments(application)
if (!MeetingLawyersIntegration.onMessageReceived(remoteMessage.data)) {
// Not a MeetingLawyers push: handle it as usual
}
}
override fun onNewToken(token: String) {
super.onNewToken(token)
MeetingLawyersPlugin.configureFromSavedArguments(application)
MeetingLawyersIntegration.onNewToken(token)
}
MeetingPros
MeetingPros apps offer lawyers (MeetingLawyers SDK) together with doctors and vets (MeetingDoctors SDK). The
MeetingPros Capacitor sample
follows the same steps with a MeetingPros plugin 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 |
|---|---|
src/plugins/meeting-pros/ | TypeScript API (definitions.ts and index.ts): configure, configureTheme, authenticate, openProfessionalList, openLawyerChat, availableFeatures, openFeature, isAuthenticated, logout |
ios/App/App/MeetingProsPlugin.swift | iOS plugin |
ios/App/App/MeetingProsIntegration.swift | iOS file that owns both SDKs |
android/.../MeetingProsPlugin.kt | Android plugin |
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.swiftuseMeetingProsIntegration, and registerMeetingProsPlugininMyViewController. - Android: also add the MeetingDoctors repository and dependencies, register
MeetingProsPlugininMainActivityand declare.MeetingProsMessagingServicein the manifest. The app theme must descend fromTheme.MaterialComponents, and remove the template'sandroidx.core.content.FileProviderfrom the manifest because MeetingDoctors declares its own:
maven { url "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"
}
Use it from TypeScript:
import { MeetingPros } from './plugins/meeting-pros';
await MeetingPros.configure({ lawyersApiKey, doctorsApiKey, environment: 'DEV' });
await MeetingPros.configureTheme({ primaryColor: '#2E7D6B' });
await MeetingPros.authenticate({ userId });
await MeetingPros.openProfessionalList({ type: 'lawyers' });
await MeetingPros.openLawyerChat({ professionalHash });
const { features } = await MeetingPros.availableFeatures();
await MeetingPros.openFeature({ feature: 'medicalHistory' });
await MeetingPros.logout();
| Method | What it does |
|---|---|
configure | Configures both SDKs. environment: 'DEV' uses the MeetingLawyers demo environment and the MeetingDoctors staging one |
configureTheme | Applies your brand color (primaryColor) to both SDKs |
authenticate | Signs the user into both SDKs, asks for push permission and registers the push token |
isAuthenticated | Resolves { authenticated }, 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 |