Content

The Content API lets you retrieve server-driven content items segmented by group, content key, and tags. The SDK provides the metadata; your application handles the actual downloading and rendering.

ContentItem shape

Each item returned by the API is a ContentItem object:

Fetching a list of items

Use getContentList(groupKey, contentKey, tags) to retrieve all items that match the given group key, content key, and an optional set of tags. Items must contain all specified tags to be included.

// All items in "banners" group with key "hero"
val items: List<ContentItem> = magify.getContentList("banners", "hero")

// Filtered by tags
val abItems: List<ContentItem> = magify.getContentList(
    groupKey = "banners",
    contentKey = "hero",
    tags = listOf("variant_a")
)

Returns List<ContentItem> — an empty list when no items match.

Fetching the earliest or latest item

The SDK recognises two reserved tags — "earliest" and "latest" — to let the server mark which item in a group should be served first or last.

// Item tagged "earliest"
val first: ContentItem? = magify.getEarliestContent("banners", "hero")
first?.link?.let { url -> load(url) }

// Item tagged "latest"
val newest: ContentItem? = magify.getLatestContent("banners", "hero")
newest?.link?.let { url -> load(url) }

Both methods return ContentItem?null when no matching item is found.

Next step

You have now completed the core Magify Android SDK integration. For a list of all available API surfaces, refer to the platform documentation.

Related articles

AdvertiserService

Android

SubscriptionService

ProductIdType

Magify Manager

InAppProduct