Skip to content
Chumbaq

In-app messages

The native iOS and Android SDKs draw each message themselves, in the layout the campaign chose, with its picture, theme and buttons. Your app only tells the SDK what's happening.

Triggers

  • App open: call it when the app comes to the foreground.
  • Screen view: call it with the screen's name on every screen change.
  • Event: call it with the event's name when something happens.
Android
ChumbaqMessages.setMessageListener(listener)

ChumbaqMessages.onAppOpen(context)
ChumbaqMessages.onScreenView(context, "Paywall")
ChumbaqMessages.onEvent(context, "purchase")
iOS
ChumbaqMessages.shared.messageListener = self

ChumbaqMessages.shared.onAppOpen()
ChumbaqMessages.shared.onScreenView("Paywall")
ChumbaqMessages.shared.onEvent("purchase")

Button taps

A tapped deep_link or url button is opened after your listener runs, so an app that routes its own links should do it in the listener. In Flutter the taps arrive as a Dart stream:

Flutter
ChumbaqMessages.instance.events.listen((event) => switch (event) {
  MessageButtonAction(:final button) => router.go(button.actionUrl!),
  _ => null,
});