Skip to main content

Inline In-App

An inline in-app message is a view component embedded directly in a page's layout. This component renders specific content based on the provided viewId. The SDK supports multiple inline messages on the same page. Inline messages do not share the pause setting with In-App Overlays, which means you can load new inline messages even if isPaused() returns true. On Android and KMP, inline in-app messages use Compose. On iOS, they use UIViewController.

Using Inline In-App Messages

Use the InlineInApp composable in your Compose code:

import com.sap.ec.mobileengage.inapp.view.InlineInAppView

@Composable
fun MyExampleView() {
InlineInAppView(viewId = viewId)
}
Android (Views/XML)

If your Android app isn't using Compose, you can still embed inline in-app messages by using a ComposeView. See: Using Compose Views in Non-Compose Android Apps.

Callbacks

InlineInAppView supports two optional callbacks to track lifecycle events:

  • onLoaded - Called when the message finishes loading and is ready to display
  • onClose - Called when the message is closed (by user)
tip

For tracking interaction events like button clicks, use the EngagementCloud.events API to subscribe to SDK events globally.

import com.sap.ec.mobileengage.inapp.view.InlineInAppView

@Composable
fun MyExampleView() {
InlineInAppView(
viewId = "my-view-id",
onLoaded = {
println("Inline in-app message loaded successfully")
},
onClose = {
println("Inline in-app message closed")
}
)
}