Skip to main content

MaestroSDKMetadata

Overview

MaestroSDKMetadata is a data class that contains optional metadata for the Maestro SDK configuration. This metadata is used primarily for analytics and platform identification purposes, allowing you to distinguish between different platforms and track unique devices.

Syntax

data class MaestroSDKMetadata(
val platformName: String? = null,
val devicePermanentId: String? = null
)

Properties

PropertyTypeDefaultDescription
platformNameString?nullUsed to distinguish the platform for analytics purposes. Examples include "AndroidTV", "Mobile", "Tablet", etc. This helps identify which platform variant is being used.
devicePermanentIdString?nullA unique ID of the device for analytics purposes. This should be a persistent identifier that remains consistent across app sessions for the same device.

Usage Example

// Create metadata with platform identification only
val metadata = MaestroSDKMetadata(
platformName = "AndroidTV"
)

// Create metadata with both platform and device ID
val metadata = MaestroSDKMetadata(
platformName = "AndroidTV",
devicePermanentId = "unique-device-identifier-12345"
)

// Create empty metadata (uses default null values)
val metadata = MaestroSDKMetadata()

// Use with MaestroSDKParameters
val params = MaestroSDKParameters(
siteId = "your-site-id",
environment = WorkingEnvironment.PRODUCTION,
metadata = MaestroSDKMetadata(
platformName = "Mobile",
devicePermanentId = getDeviceId()
)
)

Notes

  • Both properties are optional and default to null
  • The platformName is useful for distinguishing between different device types in analytics
  • The devicePermanentId should be a stable identifier that persists across app sessions
  • Consider privacy implications when using device identifiers and ensure compliance with relevant regulations

See Also