Restore purchases in mobile app in Kotlin Multiplatform SDK

Restoring Purchases is a feature that allows users to regain access to previously purchased content, such as subscriptions or in-app purchases, without being charged again. This feature is especially useful for users who may have uninstalled and reinstalled the app or switched to a new device and want to access their previously purchased content without paying again.

Note

If you built the screen in a builder, you don’t need to restore purchases manually. Wire its restore control — the Restore purchases action in the Flow & Paywall Builder, or a restore link or button in the old one — and the SDK completes the restore.

If you built the screen yourself, call the .restorePurchases() method:

import com.adapty.kmp.Adapty

Adapty.restorePurchases().onSuccess { profile ->
    if (profile.accessLevels["YOUR_ACCESS_LEVEL"]?.isActive == true) {
        // successful access restore
    }
}.onError { error ->
    // handle the error
}

Response parameters:

ParameterDescription
Profile

An AdaptyProfile object. This model contains info about access levels, subscriptions, and non-subscription purchases.

Сheck the access level status to determine whether the user has access to the app.

Tip

Want to see a real-world example of how Adapty SDK is integrated into a mobile app? Check out our sample apps, which demonstrate the full setup, including displaying paywalls, making purchases, and other basic functionality.