Skip to main content

Push Notifications

Firebase configuration

To enable push notifications, set up Firebase Cloud Messaging in your own Firebase project and share the credentials with MeetingLawyers:

  1. Create (or open) your Firebase project at Firebase Console and register your Android app with its package name.
  2. Download the google-services.json and add it to your Android project (app/ module). See the Firebase Android setup guide for the required Gradle plugin and firebase-messaging dependency.
  3. In Project settingsService accounts, click Generate new private key and send the downloaded JSON file to support@meetinglawyers.com (treat it as a credential — keep it out of source control and send it via secure email, e.g. as a password-protected archive).

Firebase Service Accounts

Push notifications

After providing the service account file, you can proceed to register your push tokens in the SDK:

class ExampleMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)

/* Your code to process remoteMessage */

/* Redirect remoteMessage to SDK */
val data = remoteMessage.data["data"]
if (data != null) {
MeetingLawyersSDK.getClientInstance().onPushMessageReceived(data)
}
}

override fun onNewToken(newToken: String) {
super.onNewToken(newToken)

/* Register new push token */
MeetingLawyersSDK.getClientInstance().onNewTokenReceived(newToken)
}
}

The SDK will only process its own messages so you can send it all incoming pushes if you can't filter them properly.