MessageRenderer component.
Configuration
Enable in-app messages when you initialize the SDK:boolean
default:"true"
Enable or disable in-app message rendering in your app. Set to
false if you
want to fully suppress all in-app messages.boolean
default:"true"
When
true, the SDK automatically fetches pending messages for the identified
user, evaluates trigger conditions, and calls your render callback when a
message is ready to display.number
default:"30"
How often (in seconds) the SDK polls for new messages. Lower values give more
timely delivery; higher values reduce network activity.
React Native Integration
To render messages, register a callback with the SDK so it can hand off a message object to your component tree whenever one is ready to display.Basic Setup
Automatic Display
WhenautoDisplayMessages is true, the SDK handles the full delivery pipeline for you:
1
Fetch pending messages
After
identify() is called, the SDK automatically retrieves any pending
messages for that user from the Tappd API.2
Evaluate trigger conditions
Each message is evaluated against its configured trigger (immediate, timed
delay, or event-based) and expiration date.
3
Invoke your render callback
When a message is ready to display, the SDK calls the function you
registered with
setMessageRenderCallback(), passing the message object.4
Track interactions automatically
The SDK automatically tracks
message.viewed, message.clicked, and
message.dismissed events as the user interacts with the message.5
Poll for new messages
The SDK continues polling at the interval defined by
messagePollingInterval to pick up newly published messages.Manual Control
If you prefer to control when messages are fetched and displayed, you can bypass automatic display and call these methods directly.- Fetch messages
- Display a specific message
- Display all pending messages
- Dismiss a message
Message Types
Popup
Popup
Popups are centered modal dialogs built on React Native’s
Modal component,
ideal for drawing focused attention.- Size: ~90% of screen width (max 500 px)
- Overlay: Optional semi-transparent background
- Animation: Fade or scale
- Use cases: Important alerts, confirmations, calls to action
Modal
Modal
Modals are larger centered dialogs with more room for rich content such as
multi-step flows or detailed information.
- Size: ~85% of screen width (max 600 px)
- Overlay: Optional semi-transparent background
- Animation: Fade or scale
- Use cases: Detailed content, forms, multi-step flows
Message Blocks
Messages are composed of one or more content blocks, each rendered as a native React Native component.Image Block
Image Block
Renders images using React Native’s
Image component.Text Block
Text Block
Renders text content using React Native’s
Text component.HTML Block
HTML Block
Renders arbitrary HTML content using
react-native-render-html.react-native-render-html is bundled inside the Tappd Mobile SDK. You do
not need to install it separately in your project.Event Tracking
The SDK tracks all standard message interactions automatically:
For custom interactions, call
trackMessageEvent() directly:
Integration with React Navigation
PlaceMessageRenderer at the root of your navigation tree so messages appear above all screens, regardless of which route is currently active:
Complete Example
API Reference
Troubleshooting
Messages not displaying
Messages not displaying
Work through this checklist if messages aren’t appearing in your app:
- Confirm
enableInAppMessagesis set totruein your SDK config. - Verify you have called
setMessageRenderCallback()in your root component. - Make sure
identify()has been called — messages are user-specific. - Enable
debug: truein the SDK config and check the console for errors. - Confirm the messages are published in your Tappd dashboard.
- Check that any configured trigger conditions are met.
Messages displaying too frequently
Messages displaying too frequently
If the same message keeps reappearing:
- Increase
messagePollingIntervalto poll less aggressively. - Check the expiration settings on the message in the dashboard.
- Ensure
dismissMessage()is being called correctly when a message is dismissed so the SDK records the dismissal.
Styling issues
Styling issues
If message styles look wrong or conflict with your app:
- Check for
StyleSheetconflicts between your app styles and theMessageRenderercomponent. - Ensure
MessageRendereris rendered at the correct level in the component tree (ideally at the root, above your navigation structure). - Test on both iOS and Android — some styles, such as shadows and font rendering, differ between platforms.