Kotlin SDK References and Release notes

Kotlin SDK release notes

The release notes are managed with the actual code https://github.com/DynamicYield/Dynamic-Yield-Mobile-SDK-Kotlin/packages/2504174 in the repository.

Kotlin SDK references

Classes

DYResult

open class DYResult(
    val status: ResultStatus,
    val warnings: List<Warning>? = null,
    val error: Exception? = null,
    val rawNetworkData: RawNetworkData? = null
)
PropertyDescriptionType
statusThe status of the Choose call. If the type is WARNING, the request was successful but contains warnings.ResultStatus:
SUCCESS, ERROR, WARNING
warningsList of warnings returned from the server. Each item includes a code and a message.List
errorException returned by the SDK.Exception?
rawNetworkDataNetwork-related data for debugging purposes.RawNetworkData?

Page

class Page(
    pageType: PageType,
    pageLocation: String,
    pageData: List<String> = listOf(),
    pageReferrer: String? = "",
    locale: String? = null,
)
PropertyDescriptionType
pageTypeThe current page type.PageType
pageLocationThe current location: URL (web), route (SPA), or screen name (mobile apps). Used for targeting.String
pageDataAdditional data for non-homepage pages: SKU for PRODUCT, category for CATEGORY, SKUs for CART, or page ID for OTHER.List
pageReferrerThe previous location: URL (web), route (SPA), or screen name (mobile).String?
localePage locale code.String?

ChooseOptions

data class ChooseOptions(  
    val isImplicitPageview: Boolean? = null,  
    val returnAnalyticsMetadata: Boolean? = null,  
    val isImplicitImpressionMode: Boolean? = null,  
)
PropertyDescriptionType
isImplicitPageviewDetermines whether to report a new pageview with the given context. Default is false. Set to true to report a new pageview when DY script is not reporting automatically.Boolean
returnAnalyticsMetadataReturns additional metadata (display names and IDs for all entities). Useful for reporting to analytics tools.Boolean
isImplicitImpressionModeReports the impression of the chosen variation. Default is true, except for Restaurants where the default is false.Boolean

Facets

// Base type for facets. Use valuesType to determine the concrete type.
open class Facet(
    open val column: String,
    open val displayName: String,
    val valuesType: FacetValuesType
)
PropertyDescriptionType
columnColumn identifier the facet applies toString
displayNameHuman-readable label for the facetString
valuesTypeFacet value categoryFacetValuesType:number, string

NumberFacet

data class NumberFacet(
    override val column: String,
    override val displayName: String,
    val min: Float,
    val max: Float
) : Facet(
    column = column,
    displayName = displayName,
    valuesType = FacetValuesType.number
)
PropertyDescriptionType
columnColumn identifier the facet applies toString
displayNameHuman-readable label for the facetString
minMinimum value of the facet rangeFloat
maxMaximum value of the facet rangeFloat
valuesTypeFacet type for numeric valuesFacetValuesType

StringFacet

data class StringFacet(
    override val column: String,
    override val displayName: String,
    val values: List<StringFacetValue>
) : Facet(
    column = column,
    displayName = displayName,
    valuesType = FacetValuesType.string
)
PropertyDescriptionType
columnColumn identifier the facet applies toString
displayNameHuman-readable label for the facetString
valuesAllowed string values for this facetList
valuesTypeFacet type for string valuesFacetValuesType

Widget

class Widget(
    val title: String,
    val slots: List<RecsSlot>
)
PropertyDescriptionType
titleWidget title.String
slotsList of recommendation slots.List

Enums

Channel

enum class Channel(val valueStr: String) {
    APP("APP"),
    KIOSK("KIOSK"),
    DRIVE_THRU("DRIVE-THRU");
}

DeviceType

enum class DeviceType {
    SMARTPHONE,
    TABLET,
    KIOSK,
    ODMB
}

PageType

enum class PageType {
    HOMEPAGE,
    CATEGORY,
    PRODUCT,
    CART,
    OTHER
}

OrderFulfillment

enum class OrderFulfillment {
    DELIVERY,
    PICKUP,
    DINEIN,
    CURBSIDE
}

SortOrderType

enum class SortOrderType {
    ASC,
    DESC
}

VideoProgressType

enum class VideoProgressType {
    VIDEO_STARTED,
    PREROLL_FINISHED,
    VIDEO_FINISHED,
    VIDEO_PROGRESS
}

FacetValuesType

enum class FacetValuesType {
    number,
    string
}