Adapty

object Adapty

Properties

Link copied to clipboard

Returns whether activate has been called.

Link copied to clipboard

Set to the most appropriate level of logging.

Functions

Link copied to clipboard
fun activate(context: Context, config: AdaptyConfig)
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, loadTimeout: TimeInterval = DEFAULT_PAYWALL_TIMEOUT, callback: ResultCallback<AdaptyPaywall>)

Fetches the paywall by the specified placement.

Link copied to clipboard
fun getPaywallForDefaultAudience(placementId: String, locale: String? = null, fetchPolicy: AdaptyPaywall.FetchPolicy = AdaptyPaywall.FetchPolicy.Default, callback: ResultCallback<AdaptyPaywall>)

Fetches the paywall of the specified placement for the All Users audience.

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 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.