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
RadarInAppMessage.Text
required
The title text and color configuration for the message.
RadarInAppMessage.Text
required
The body text and color configuration for the message.
RadarInAppMessage.Button
Optional button configuration with text, colors, and deep link.
RadarInAppMessage.Image
Optional image configuration with name and URL.
[String: Sendable]
required
Custom metadata dictionary associated with the message.
Nested Types
RadarInAppMessage.Text
Represents text content with styling.String
required
The text content to display.
UIColor
required
The color of the text.
RadarInAppMessage.Button
Represents an interactive button with optional deep link.String
required
The button text to display.
UIColor
required
The text color of the button.
UIColor
required
The background color of the button.
String
Optional deep link URL to open when the button is tapped.
RadarInAppMessage.Image
Represents an image to display in the message.String
required
The name identifier for the image.
String
required
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.RadarInAppMessage.Text
required
The title text and color configuration.
RadarInAppMessage.Text
required
The body text and color configuration.
RadarInAppMessage.Button
Optional button configuration.
RadarInAppMessage.Image
Optional image configuration.
[String: Sendable]
required
Custom metadata dictionary.
Class Methods
fromDictionary(_:)
Creates an in-app message from a dictionary representation.[String: Any]
required
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.Any
required
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