Mobile Component Guide


Overview

This guide walks through integrating Paze® Messages into native mobile applications using the Paze Messages API and mobile UI components. It covers message rendering, styling, dark mode support, HTML formatting, link handling, server integration, caching, and accessibility considerations.


Implementing Messages

The Paze message component displays promotional content returned by the Paze Messages API. In terms of implementation, the mobile message component is defined and rendered by the merchant, but the actual message (content and date range) is retrieved via the API.


If you haven't already, start with one of the available checkout flows:


Sequence

The basic sequence is followed directly from the selected checkout flow.


  1. Generate Client Assertion
  2. Get Access Token
  3. To display the message alongside the Paze payment option, first configure the message
  4. Fetch the message from the server
  5. Render the message
  6. Continue with the selected checkout flow




Mobile Platform

Select your Mobile platform for the Message integration


Add the Messaging component

PazeMessage(
    message = "Earn <b>5%</b> cash back with Paze®",
    style = PazeMessageStyle.FILLED,
    darkMode = true,
    onLinkClick = { url -> openInAppBrowser(url) }
)
<com.paze.merchant.paze.message.xml.PazeMessageView
    android:id="@+id/pazeMessage"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:message="Earn 5% cash back with Paze®"
    app:messageStyle="default_style" />

pazeMessage.setMessage(
    html = messageHtml,
    style = PazeMessageStyle.FILLED,
    darkMode = true,
    onLinkClick = { url -> openInAppBrowser(url) }
)

Message Attributes


message string required

message is the HTML content from the Paze Messages API, contentHtml field.

The message attribute cannot be empty. The actual displayed message is returned from the Paze API as HTML and parsed by the PazeMessage component to retrieve the message. If the message attribute is empty when defined in PazeMessage, the message will not be displayed.

Example: message = "Save with Paze®"


PazeMessageStyle string required

PazeMessageStyle defines the appearance of the message. It defines font color, background, and border. Light mode vs dark mode will determine the colors for each.

Options:

  • DEFAULT ( default value ) : Transparent background, no border
  • FILLED : Message has a colored background.
  • OUTLINED : Message has a border.

Example: "style = PazeMessageStyle.DEFAULT"


darkMode boolean optional

darkMode defines the color scheme of the message. See the table below for the mapping of style to the theme.

Options:

  • null/nill ( default value ) : Auto-detect from system configuration.
  • true : Force dark mode colors(white text, white links, midnight black containers).
  • false : Force light mode colors (black text, blue links, pale grey/white containers).
Stylefalse (Light Mode)true (Dark Mode)
DEFAULTTransparent bg, black textTransparent bg, white text
FILLED#F4F7FF fill, black text#151B33 fill, white text
OUTLINEDWhite fill + #E0E0E0 border#151B33 fill + #E0E0E0 border

Example: "darkMode = true"


onLinkClick

function optional

onLinkClick defines a function for how to handle opening a link inside the message body.
By default, links open in-context using a Custom Tab on Android

Example:

PazeMessage(
    message = "See <a href=\"https://www.paze.com/offers#tc">terms</a>",
    style = PazeMessageStyle.DEFAULT,
    onLinkClick = { url -> openInAppBrowser(url) }
)
pazeMessage.setMessage(
    html = "See <a href=\"https://www.paze.com/terms\">terms</a>",
    style = PazeMessageStyle.DEFAULT,
    onLinkClick = { url -> openInAppBrowser(url) }
)

On mobile, message-id and message-placement are server-side API parameters used when calling the Paze Messages API from your Merchant Server. They are not passed to the mobile components. The app only receives the resulting contentHtml string.



Logo Rendering (Mobile Only)

The mobile components do not support dynamic image fetching from HTML content. Instead, <img> tags in the message HTML are stripped and replaced with a native Paze logo rendered inline. The logo is tinted to match the current style (Paze Blue in light mode, white in dark mode).

No additional configuration is needed on the client. The components detect <img> tags and render the native logo automatically.


Supported HTML (Mobile Only)

The mobile components parse a subset of HTML tags:

TagPurpose
<b>, <strong>Bold text
<i>, <em>Italic text
<u>Underlined text
<sup>, <sub>Superscript / subscript
<a href="...">Tappable links
<br>Line breaks
<img>Stripped and replaced with native Paze logo (images are not fetched)

Any tags not listed above are ignored by the mobile components.


Server Integration

On mobile, your Merchant Server calls the Paze Messages API and passes the contentHtml field to the app. The mobile app does not call the Messages API directly.

Refer to the Messages API to retrieve Paze messages.


Messages API Endpoints

EnvironmentURL
Sandboxhttps://b2b.wallet.uat.earlywarning.io/marketing/v2/messages
UAThttps://b2b.wallet.cat.earlywarning.io/marketing/v2/messages
Productionhttps://b2b.wallet.earlywarning.com/marketing/v2/messages

Query Parameters

ParameterDescription
messagePlacementWhere the message appears: checkout, productPage, cartPage, or mobile variants (checkoutMobile, productPageMobile, cartPageMobile)
profileIdOptional Paze profile ID for personalized messages

Fetch from Server and Display

val messageHtml = merchantApi.getOfferMessage()

PazeMessage(message = messageHtml)
val messageHtml = merchantApi.getOfferMessage()

pazeMessage.setMessage(html = messageHtml)

WHAT: Display promotional or informational Paze messages near the Paze checkout experience.

WHY: Helps increase awareness of Paze benefits, offers, and available payment options before checkout.

WHEN: Display wherever the Paze Button is rendered, including product detail, cart, checkout, and mobile experiences.

BEST PRACTICES: Always place the Paze Message near the Paze Button.

Caching (Mobile Only)

Your server fetches the message content, and you should cache the contentHtml string in memory for the session since offer messages change infrequently.

StrategyWhen to FetchBenefit
App launchOn startup or first scene activationOffer is ready instantly, zero UI delay
Page loadWhen fetching product or cart dataPairs naturally with existing network calls
Cart/checkout initWhen the user enters cart or checkoutOffer is ready before render

Avoid fetching only when the message component is about to display. The asynchronous API call causes the message area to pop in after load, shifting surrounding UI and creating visible layout jank.


Accessibility

The mobile components provide built-in accessibility support. When using the default dark mode setting (null/nil, which follows the system theme), the components use accessible color combinations. If you force dark mode with an explicit darkMode value, color accessibility is not guaranteed.

FeatureDetail
TextReadable by TalkBack as a single semantic node
LogoDecorative and excluded from TalkBack announcements
LinksFocusable and announced with their link text
UnderlinesAll links underlined for non-color-dependent identification




Did this page help you?