---
updatedAt: 2026-09-08T13:26:03.000Z
agentTools:
  projectIndex: https://developer.paze.com/public/llms.txt
---

# Mobile Component Guide

<br />

# 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.

<br />

## 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.

<br />

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

* [Button Initiated Express Pay](https://developer.paze.com/public/docs/paynow-mobile-guide)
* [Button Initiated Review & Pay](https://developer.paze.com/public/docs/review-pay-mobile-guide)

<br />

### Sequence

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

<br />

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

<br />

<br />

![](https://files.readme.io/e94d7f7c148ada0733e25690584c63bbd0b14488e9fb2919a267ef54ad1caaca-mobile_sequence_diagram.jpg)

<br />

<br />

## Mobile Platform

Select your Mobile platform for the Message integration

<br />

<Tabs>
  <Tab title="Android">
    &#x20;&#x20;

    ## Add the Messaging component

    ```kotlin Jetpack Compose
    PazeMessage(
        message = "Earn <b>5%</b> cash back with Paze®",
        style = PazeMessageStyle.FILLED,
        darkMode = true,
        onLinkClick = { url -> openInAppBrowser(url) }
    )
    ```
    ```kotlin XML Views
    <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) }
    )
    ```

    <br />

## &#x20;Message Attributes

***

<a id="message-html"></a>**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®"

***

<a id="message-style"></a>**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"

***

<a id="message-theme"></a>**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).

| Style      | false (Light Mode)          | true (Dark Mode)              |
| ---------- | --------------------------- | ----------------------------- |
| `DEFAULT`  | Transparent bg, black text  | Transparent bg, white text    |
| `FILLED`   | #F4F7FF fill, black text    | #151B33 fill, white text      |
| `OUTLINED` | White fill + #E0E0E0 border | #151B33 fill + #E0E0E0 border |

<br />

**Example:** "darkMode = true"

***

<a id="message-onLinkClick"></a>**onLinkClick**

<HTMLBlock>{`

<div style="margin-top: -15px;">
<em>function</em>
	<span class="usage-pill usage-optional">optional</span>
</div>
`}</HTMLBlock>

<br />

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

**Example**:

```kotlin Jetpack Compose
PazeMessage(
    message = "See <a href=\"https://www.paze.com/offers#tc">terms</a>",
    style = PazeMessageStyle.DEFAULT,
    onLinkClick = { url -> openInAppBrowser(url) }
)
```
```kotlin XML Views
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.

<br />

    <br />

## 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.

<br />

## Supported HTML (Mobile Only)

The mobile components parse a subset of HTML tags:

| Tag               | Purpose                                                              |
| ----------------- | -------------------------------------------------------------------- |
| `<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.

<br />

## 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](https://developer.paze.com/public/docs/api-messages) to retrieve Paze messages.

<br />

### Messages API Endpoints

| Environment | URL                                                            |
| ----------- | -------------------------------------------------------------- |
| Sandbox     | `https://b2b.wallet.uat.earlywarning.io/marketing/v2/messages` |
| UAT         | `https://b2b.wallet.cat.earlywarning.io/marketing/v2/messages` |
| Production  | `https://b2b.wallet.earlywarning.com/marketing/v2/messages`    |

<br />

### Query Parameters

| Parameter          | Description                                                                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `messagePlacement` | Where the message appears: `checkout`, `productPage`, `cartPage`, or mobile variants (`checkoutMobile`, `productPageMobile`, `cartPageMobile`) |
| `profileId`        | Optional Paze profile ID for personalized messages                                                                                             |

    ### Fetch from Server and Display

    ```kotlin Jetpack Compose
    val messageHtml = merchantApi.getOfferMessage()

    PazeMessage(message = messageHtml)
    ```
    ```kotlin XML Views
    val messageHtml = merchantApi.getOfferMessage()

    pazeMessage.setMessage(html = messageHtml)
    ```

    <Callout theme="default">
      **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.
    </Callout>

    ## 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.

| Strategy           | When to Fetch                         | Benefit                                     |
| ------------------ | ------------------------------------- | ------------------------------------------- |
| App launch         | On startup or first scene activation  | Offer is ready instantly, zero UI delay     |
| Page load          | When fetching product or cart data    | Pairs naturally with existing network calls |
| Cart/checkout init | When the user enters cart or checkout | Offer 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.

<br />

## 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.

    | Feature    | Detail                                                      |
    | ---------- | ----------------------------------------------------------- |
    | Text       | Readable by TalkBack as a single semantic node              |
    | Logo       | Decorative and excluded from TalkBack announcements         |
    | Links      | Focusable and announced with their link text                |
    | Underlines | All links underlined for non-color-dependent identification |
  </Tab>

  <Tab title="iOS">
    ## Add the Messaging component

    ```swift SwiftUI
    PazeMessage.View(
        html: "Earn <b>5%</b> cash back with Paze®",
        style: .standard,
        darkMode: true,
        onLinkTap: { url in
            openInAppBrowser(url)
        }
    )
    ```
    ```swift UIKit
    let pazeMessage = PazeMessage()
    pazeMessage.setMessage(
        html: "Earn <b>5%</b> cash back with Paze®",
        style: .standard,
        darkMode: true,
        onLinkTap: { url in
            UIApplication.shared.open(url)
        }
    )
    stackView.addArrangedSubview(pazeMessage)
    ```

    <br />

## &#x20;Message Attributes

***

<a id="msg-iOS-html"></a>**html** _string_ required

`html` is used with SwiftUI and is the 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.

The UIKit PazeMessage automatically sets isHidden = true when the HTML string is nil or empty, so no manual visibility management is needed.

**Example:**  html: "Earn <b>5%</b> cash back with Paze®",

***

<a id="msg-iOS-style"></a>**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:

- `.standard`  ( default value ) :  Transparent background, no border
- `.filled` :  Message has a colored background.
- `.outlined` :  Message has a border.

Container dimensions for .filled and .outlined styles: 4pt corner radius, 8pt padding. The .outlined style adds a 1pt border in #E0E0E0. |

<br />

**Example:** "style: .filled"

***

<a id="msg-iOS-theme"></a>**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).

| Style      | false (Light Mode)          | true (Dark Mode)              |
| ---------- | --------------------------- | ----------------------------- |
| `DEFAULT`  | Transparent bg, black text  | Transparent bg, white text    |
| `FILLED`   | #F4F7FF fill, black text    | #151B33 fill, white text      |
| `OUTLINED` | White fill + #E0E0E0 border | #151B33 fill + #E0E0E0 border |

<br />

**Example:** "darkMode: true"

***

<a id="msg-iOS-onLinkClick"></a>**onLinkTap**

<HTMLBlock>{`

<div style="margin-top: -15px;">
<em>function</em>
	<span class="usage-pill usage-optional">optional</span>
</div>
`}</HTMLBlock>

<br />

`onLinkTap` 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 SFSafariViewController on iOS.

**Example**:

```swift SwiftUI
 PazeMessage.View(
     html: "See <a href=\"https://www.paze.com/offers#tc\">terms</a>",
     style: .standard,
     onLinkTap: { url in
         openInAppBrowser(url)
     }
 )
```
```swift UIKit
let pazeMessage = PazeMessage()
pazeMessage.setMessage(
    html: "See <a href=\"https://www.paze.com/terms\">terms</a>",
    style: .standard,
    onLinkTap: { url in
        UIApplication.shared.open(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.

    <br />

## 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.

<br />

## Supported HTML (Mobile Only)

The mobile components parse a subset of HTML tags:

| Tag               | Purpose                                                              |
| ----------------- | -------------------------------------------------------------------- |
| `<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.

<br />

## 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](https://developer.paze.com/public/docs/api-messages) to retrieve Paze messages.

<br />

### Messages API Endpoints

| Environment | URL                                                            |
| ----------- | -------------------------------------------------------------- |
| Sandbox     | `https://b2b.wallet.uat.earlywarning.io/marketing/v2/messages` |
| UAT         | `https://b2b.wallet.cat.earlywarning.io/marketing/v2/messages` |
| Production  | `https://b2b.wallet.earlywarning.com/marketing/v2/messages`    |

<br />

### Query Parameters

| Parameter          | Description                                                                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `messagePlacement` | Where the message appears: `checkout`, `productPage`, `cartPage`, or mobile variants (`checkoutMobile`, `productPageMobile`, `cartPageMobile`) |
| `profileId`        | Optional Paze profile ID for personalized messages                                                                                             |

    ### Fetch from Server and Display

    ```swift SwiftUI
    let messageHtml = try await merchantAPI.getOfferMessage()

    PazeMessage.View(message: messageHtml)
    ```
    ```swift UIKit
    let messageHtml = try await merchantAPI.getOfferMessage()
    let pazeMessage = PazeMessage()

    pazeMessage.setMessage(html: messageHtml)
    ```

    <Callout theme="default">
      **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.
    </Callout>

    ## 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.

| Strategy           | When to Fetch                         | Benefit                                     |
| ------------------ | ------------------------------------- | ------------------------------------------- |
| App launch         | On startup or first scene activation  | Offer is ready instantly, zero UI delay     |
| Page load          | When fetching product or cart data    | Pairs naturally with existing network calls |
| Cart/checkout init | When the user enters cart or checkout | Offer 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.

<br />

## 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.

    | Feature    | Detail                                                      |
    | ---------- | ----------------------------------------------------------- |
    | Text       | Readable by VoiceOver as accessible text                    |
    | Logo       | Decorative and hidden from VoiceOver                        |
    | Links      | Tappable and announced by VoiceOver with their link text    |
    | Underlines | All links underlined for non-color-dependent identification |
  </Tab>
</Tabs>

<br />

<HTMLBlock>{`

<style>
.paze-field-line, .paze-field-meta {
  margin-left: 0px !important;
}
</style>
`}</HTMLBlock>

<br />

<HTMLBlock>{`
<style>
  section.content-toc.grid-25 {
    display: none !important;
  }
  section.content-body.grid-75 {
  flex: 1 1 100% !important; /* grow + full basis */
  max-width: 100% !important;
  width: 100% !important;
}

.field-description>*, .markdown-body>* {
    margin: 0 !important;
}

  section.content-body.grid-75 .rm-Markdown > br:first-of-type {
    display: none !important;
  }
</style>
`}</HTMLBlock>

<br />