getPaywall

fun getPaywall(placementId: String, locale: String? = null, fetchPolicy: AdaptyPaywall.FetchPolicy = AdaptyPaywall.FetchPolicy.Default, @IntRange(from = 1000) loadTimeoutMillis: Int = DEFAULT_PAYWALL_TIMEOUT_MILLIS, callback: ResultCallback<AdaptyPaywall>)

Adapty allows you remotely configure the products that will be displayed in your app. This way you don’t have to hardcode the products and can dynamically change offers or run A/B tests without app releases.

Should not be called before activate

See also

Parameters

placementId

The identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.

locale

This parameter is expected to be a language code composed of one or more subtags separated by the "-" character. The first subtag is for the language, the second one is for the region (The support for regions will be added later). Example: "en" means English, "en-US" represents US English. If the parameter is omitted, the paywall will be returned in the default locale.

fetchPolicy

By default SDK will try to load data from server and will return cached data in case of failure. Otherwise use AdaptyPaywall.FetchPolicy.ReturnCacheDataElseLoad to return cached data if it exists.

loadTimeoutMillis

This value limits the timeout for this method. If the timeout is reached, cached data or local fallback will be returned. The minimum value is 1000 milliseconds. If a timeout is not required, you can pass Int.MAX_VALUE (or use Integer.MAX_VALUE when calling from Java).

callback

A result containing the AdaptyPaywall object. This model contains the list of the products ids, paywall’s identifier, custom payload, and several other properties.