Property types
Experience templates support a range of Property types to meet a broad range of Experience use cases.
Operators schedule property values under the targeted Scenarios of an Experience. These values are delivered to SDKs at runtime, offering customized Experiences to the active user.
When generating integration code, Experience templates and their Property types are represented through this code.
Supported Properties along with their native type for each available language are defined below.
#
ColorA Color object contains a hexadecimal string value
(e.g #6e3cbd
), along
with a decimal opacity
between 0
and 1
, where 0
is fully transparent.
The Color object will always be defined and never null.
When not defined by an MTRIBES operator, the opacity
property
defaults to 1
and value
defaults to undefined, null or the equivalent
in your target language.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
interface Color { value: string | undefined; opacity: number;}
class ColorProperty( // here we set `value` as nullable without defaulting to an empty String // as an empty String will throw a ParseException during UI rendering. public ColorProperty(@Nullable String value, Float opacity){ ... })
data class ColorProperty( // here we set `value` as nullable without defaulting to an empty String // as an empty String will throw a ParseException during UI rendering. val value: String? = null, val opacity: Float = 1.0f)
struct MTColor { let value: String? let opacity: CGFloat}
type String
#
DateDates are returned to our SDKs as an ISO-8601
UTC string.
Where supported, we surface these in the native Date type of your
target language.
If no value is defined in MTRIBES, the value returned will be
undefined
, null
or the equivalent in your target language.
If however the target language only supports surfacing the raw
string representations, then an empty string will be surfaced
when the date is unknown.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type Date | undefined
@Nullablejava.util.Date
java.util.Date?
Foundation.Date?
//dates remain in raw string format due to SceneGraph restrictions//where it's not possible to transfer native "roDate" instances//between components.
//At the point of usage, parse data-string into an "roData".//Empty string when date is unknown.
type String
#
ListA List is an array of arbitrary string values.
The returned List will default to an empty array if no values are defined in MTRIBES. It will never be null.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type Array<string>
@NonNulljava.util.List<String>
kotlin.collections.List<String> = emptyList()
[String] = []
type Array
#
NumberNumbers represent an integer or decimal value.
If no value is defined in MTRIBES, the value returned will be undefined, null or the equivalent in your target language.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type Number | undefined
@Nullablejava.lang.Number
kotlin.Number?
Swift.Double?
type Number | invalid
#
SelectSelect types represent a singular string value chosen from a discrete list, by an scheduler in MTRIBES.
If no value was chosen, an empty string will be surfaced. This value will never be null.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type String
@NonNulljava.lang.String
kotlin.String = ""
Swift.String = ""
type String
#
SwitchA Switch is a boolean value of either true
or false
.
The value will default to false
in MTRIBES and can never be null.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type Boolean
@NonNullBoolean
Boolean = false
Swift.Bool = false
type Boolean
#
TextText is an arbitrary string value entered by a scheduler in MTRIBES.
If no value was entered, an empty string will be surfaced. This value will never be null.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type String
@NonNulljava.lang.String
kotlin.String = ""
Swift.String = ""
type String
#
URLA URL is a string value entered by an MTRIBES operator, which represents a URL to a resource. For example; an image or a data feed.
If no value was entered, an empty string will be surfaced. This value will never be null.
- JavaScript
- Java
- Kotlin
- Swift
- Roku
type String
@NonNulljava.lang.String
kotlin.String = ""
Foundation.URL?
type String