Display an In-App Changelog for a new published version

In-App Changelog is a great way to engage your users. Learn here how to display the In-App Changelog with a new published version

In-App Changelog content

In LocalGetWhatsNewRepository find a whatsNewFor function that returns a list of FeatureItemData.

A FeatureItemData is just a data class with

  • an image vector

  • an icon tint color

  • an icon background color

  • a title

  • a description

This way in whatsNewFor you can do this:

return when (build) {
    "3" -> changelog3
    "4" -> changelog4 
    etc
}

The title and description can be localized like :

FeatureItemData(
    imageVector = Icons.Rounded.Collections,
    iconTint = Color(0XFF161415),
    iconBackgroundColor = Color(0xFFb4a13e),
    title = SharedRes.strings.collection_feature,
    text = SharedRes.strings.collection_feature_description
)

Learn more about localization here.

Get In-App Changelog from server

The function whatsNewFor is a suspend function: this means you can easily plugs a connexion to a server to fetch the in-app changelog. Example:

class WhatsNewRepository(inAppChangelogApi: InAppChangelogApi) {

    suspend fun whatsNewFor(build: String): List<FeatureItemData> {
        return inAppChangelogApi.get(build)
    }
}

Update the latest version seen

UpdatesLatestWhatsNewSeen

Last updated