Skip to main content

Push Notifications

Push works over Firebase Cloud Messaging on both platforms. No Notification Service Extension is required on iOS.

Firebase configuration​

  1. Create (or open) your Firebase project at Firebase Console and register your iOS and Android apps with their bundle id / package name.
  2. Add the config files to the native projects:
    • iOS: GoogleService-Info.plist added to the App target in Xcode.
    • Android: google-services.json in android/app/.
  3. In Project settings → Service accounts, generate a private key and send it to support@meetinglawyers.com so our backend can send pushes to your app (treat it as a credential — keep it out of source control and send it via secure email).
Android

The MeetingLawyers SDK pulls in Firebase Crashlytics. Once google-services.json is present, apply the com.google.gms.google-services and com.google.firebase.crashlytics gradle plugins or the app crashes on launch with "The Crashlytics build ID is missing".

Register the device​

After authenticating, ask for the notification permission and register the FCM token with the SDK:

import { MeetingLawyers } from './plugins/meeting-lawyers';

await MeetingLawyers.registerForPushNotifications();

The promise rejects with a descriptive message when Firebase is not configured; the rest of the integration keeps working without push.

Message forwarding​

The wrapper already forwards everything to the SDK natively:

  • iOS: the plugin acts as MessagingDelegate and UNUserNotificationCenterDelegate. MeetingLawyers pushes are handed to the SDK (which shows them and opens the chat when tapped); any other push is shown normally.
  • Android: MeetingLawyersFirebaseService forwards FCM messages and token refreshes to the SDK. If your app already has its own FirebaseMessagingService, add these forwards to it instead:
@Override
public void onMessageReceived(@NonNull RemoteMessage message) {
super.onMessageReceived(message);
String data = message.getData().get("data");
if (data != null && MeetingLawyersSDK.Companion.isInitialized()) {
MeetingLawyersSDK.Companion.getClientInstance().onPushMessageReceived(data);
}
}

@Override
public void onNewToken(@NonNull String token) {
super.onNewToken(token);
if (MeetingLawyersSDK.Companion.isInitialized()) {
MeetingLawyersSDK.Companion.getClientInstance().onNewTokenReceived(token);
}
}
note

Push is not available on every iOS simulator: it requires an Apple Silicon Mac with a recent macOS and Xcode. If the FCM token cannot be obtained on your simulator, test push reception on a physical device.