MeiroNativeRenderer

fun interface MeiroNativeRenderer

Draws native in-app messages with the app's own views, for example its design system components.

The SDK still selects, personalizes, and presents the message, loads its images, and tracks its events. Set it once with MeiroInAppMessaging.nativeRenderer; it applies to every backend profile.

MeiroInAppMessaging.nativeRenderer = MeiroNativeRenderer { context, message, actions ->
ComposeView(context).apply { setContent { BrandMessage(message, actions) } }
}

Functions

Link copied to clipboard
abstract fun render(context: Context, message: MeiroNativeMessage, actions: MeiroNativeActions): View?

Called on the main thread after the images are loaded. Return null to use the SDK view for this message. If this function throws, the SDK skips the message. Errors in later composition or layout are app errors. The SDK scrolls long content, so the view must not scroll itself (no LazyColumn or verticalScroll).