Overview
RadarInAppMessage is a data model class that represents an in-app message delivered by the Radar SDK. It contains structured content including title, body text, optional button, optional image, and custom metadata.
The message supports full customization of colors, text, and interactive elements like deep links.
Properties
The title text and color configuration for the message.
The body text and color configuration for the message.
Optional button configuration with text, colors, and deep link.
Optional image configuration with name and URL.
Custom metadata dictionary associated with the message.
Nested Types
RadarInAppMessage.Text
Represents text content with styling.The text content to display.
The color of the text.
RadarInAppMessage.Button
Represents an interactive button with optional deep link.The button text to display.
The text color of the button.
The background color of the button.
Optional deep link URL to open when the button is tapped.
RadarInAppMessage.Image
Represents an image to display in the message.The name identifier for the image.
The URL where the image can be fetched.
Initializer
init(title:body:button:image:metadata:)
Creates a new in-app message with the specified components.The title text and color configuration.
The body text and color configuration.
Optional button configuration.
Optional image configuration.
Custom metadata dictionary.
Class Methods
fromDictionary(_:)
Creates an in-app message from a dictionary representation.Dictionary containing the message data. Must include “title” and “body” keys at minimum.
RadarInAppMessage instance if the dictionary contains valid data, or nil if required fields are missing.
fromArray(_:)
Creates an array of in-app messages from an array representation.Array of dictionaries, each representing an in-app message.
RadarInAppMessage instances. Invalid entries are filtered out.
Instance Methods
toDictionary()
Converts the in-app message to a dictionary representation.Example Usage
See Also
- RadarInAppMessageProtocol - Delegate protocol for handling in-app message events