message.comDevelopers

Android SDK Coming soon

Native Android SDK for embedding the message.com chat surface in your app. Kotlin-first, Jetpack Compose compatible, minSdk 24 (Android 7.0). API mirrors the iOS and web SDKs so cross-platform teams share one mental model.

The native Android SDK is committed but unscoped. In the meantime, the widget runs inside a WebView without changes if you set setJavaScriptEnabled(true) and grant network permissions.

Installation

The SDK ships through Maven Central. The Kotlin variant is the primary artefact; a Java-friendly facade is shipped alongside for legacy projects.

build.gradle.kts
// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        mavenCentral()
    }
}

// app/build.gradle.kts
dependencies {
    implementation("com.message:sdk:1.0.0")
}

Initialise

Call Message.configure once from your Application class. Network connections are deferred until the chat surface is opened, keeping cold-start times unaffected.

MyApp.kt
// MyApp.kt
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Message.configure(this, workspaceId = "abc123")
    }
}

Identify the user

Call Message.identify as soon as you have a signed-in user. The userHash is required for production traffic. See identifying visitors for the HMAC scheme.

AuthFlow.kt
// After auth completes
Message.identify(
    userId = user.id,
    email = user.email,
    name = user.fullName,
    userHash = user.messageUserHash // HMAC, computed server-side
)

Open the chat surface

The default presentation is a bottom-sheet style modal that respects edge-to-edge insets. You can also embed MessageView as a composable inside your own layout.

HelpScreen.kt
// In any Activity or Fragment
helpButton.setOnClickListener {
    Message.open(this)
}

Push notifications via FCM

Register the device's FCM token with the SDK. When an agent replies and the user is backgrounded, our backend sends a push via your Firebase project. Provide your service-account JSON in the dashboard.

FirebaseMessaging.kt
// MyFirebaseMessagingService.kt
override fun onNewToken(token: String) {
    Message.register(fcmToken = token)
}

override fun onMessageReceived(remoteMessage: RemoteMessage) {
    if (Message.isMessagePush(remoteMessage)) {
        Message.handlePush(remoteMessage)
        return
    }
    // your own push handling here
}

UI customisation

  • Material 3 themed by default; honours your colorScheme.
  • Light and dark modes follow the system setting.
  • Localisation reads from your app's default locale; override per-call.
  • Full Jetpack Compose composable MessageView for custom embedding.

Required permissions

The SDK requires android.permission.INTERNET. For voice-message capture (a planned feature), android.permission.RECORD_AUDIO will be requested at runtime. The SDK never accesses location, contacts, or the camera unless explicitly invoked.

Common pitfalls

  • Compute userHash server-side. Never bake the workspace secret into the app.
  • Use process-wide initialisation. Avoid calling configure from an Activity; it is cheap but should be set up once.
  • Test on a clean device profile. Push tokens are per-install; reinstalling rotates the token.