Adapty

object Adapty

Functions

Link copied to clipboard
fun activate(context: Context, appKey: String, observerMode: Boolean = false, customerUserId: String? = null)

Use this method to initialize the Adapty SDK.

Link copied to clipboard
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.

Link copied to clipboard

Once you have an AdaptyPaywall, fetch corresponding products list using this method.

Link copied to clipboard

The main function for getting a user profile. Allows you to define the level of access, as well as other parameters.

Link copied to clipboard
fun getViewConfiguration(paywall: AdaptyPaywall, locale: String, @IntRange(from = 1000) loadTimeoutMillis: Int = DEFAULT_PAYWALL_TIMEOUT_MILLIS, callback: ResultCallback<AdaptyViewConfiguration>)

If you are using the Paywall Builder, you can use this method to get a configuration object for your paywall.

Link copied to clipboard
fun identify(customerUserId: String, callback: ErrorCallback)

Use this method for identifying user with it’s user id in your system.

Link copied to clipboard

You can logout the user anytime by calling this method.

Link copied to clipboard
fun logShowOnboarding(name: String?, screenName: String?, @IntRange(from = 1) screenOrder: Int, callback: ErrorCallback? = null)

Call this method to keep track of the user’s steps while onboarding.

Link copied to clipboard

Call this method to notify Adapty SDK, that particular paywall was shown to user.

Link copied to clipboard
fun makePurchase(activity: Activity, product: AdaptyPaywallProduct, subscriptionUpdateParams: AdaptySubscriptionUpdateParameters? = null, isOfferPersonalized: Boolean = false, callback: ResultCallback<AdaptyPurchasedInfo?>)

To make the purchase, you have to call this method.

Link copied to clipboard

To restore purchases, you have to call this method.

Link copied to clipboard

To set fallback paywalls, use this method. You should pass exactly the same payload you’re getting from Adapty backend. You can copy it from Adapty Dashboard.

Link copied to clipboard

Override the default logger behavior using this method.

Link copied to clipboard

Implement this method to receive automatic profile updates.

Link copied to clipboard
fun setVariationId(forTransactionId: String, variationId: String, callback: ErrorCallback)

In Observer mode, Adapty SDK doesn’t know, where the purchase was made from. If you display products using our Paywalls or A/B Tests, you can manually assign variation to the purchase. After doing this, you’ll be able to see metrics in Adapty Dashboard.

Link copied to clipboard
fun updateAttribution(attribution: Any, source: AdaptyAttributionSource, networkUserId: String? = null, callback: ErrorCallback)
Link copied to clipboard

You can set optional attributes such as email, phone number, etc, to the user of your app. You can then use attributes to create user segments or just view them in CRM.

Properties

Link copied to clipboard

Set to the most appropriate level of logging.