AdaptySDK
AdaptySDK.Adapty Class Reference

The main class for interacting with the Adapty SDK. More...

Static Public Member Functions

static void Activate (AdaptyConfiguration.Builder configurationBuilder, Action< AdaptyError > completionHandler)
 Use this method to initialize the Adapty SDK.
static void Activate (AdaptyConfiguration configuration, Action< AdaptyError > completionHandler)
 Use this method to initialize the Adapty SDK.
static void GetPaywall (string placementId, Action< AdaptyPaywall, AdaptyError > completionHandler)
 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.
static void GetPaywall (string placementId, AdaptyPlacementFetchPolicy fetchPolicy, TimeSpan? loadTimeout, Action< AdaptyPaywall, AdaptyError > completionHandler)
 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.
static void GetPaywall (string placementId, string locale, Action< AdaptyPaywall, AdaptyError > completionHandler)
 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.
static void GetPaywall (string placementId, string locale, AdaptyPlacementFetchPolicy fetchPolicy, TimeSpan? loadTimeout, Action< AdaptyPaywall, AdaptyError > completionHandler)
 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.
static void GetOnboarding (string placementId, string locale, AdaptyPlacementFetchPolicy fetchPolicy, TimeSpan? loadTimeout, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 Adapty allows you remotely configure onboarding screens that will be displayed in your app. This way you don't have to hardcode the onboarding content and can dynamically change it or run A/B tests without app releases.
static void GetPaywallForDefaultAudience (string placementId, string locale, AdaptyPlacementFetchPolicy fetchPolicy, Action< AdaptyPaywall, AdaptyError > completionHandler)
 This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetOnboardingForDefaultAudience (string placementId, string locale, AdaptyPlacementFetchPolicy fetchPolicy, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetPaywallProducts (AdaptyPaywall paywall, Action< IList< AdaptyPaywallProduct >, AdaptyError > completionHandler)
 Fetches the products array for a given paywall.
static void GetProfile (Action< AdaptyProfile, AdaptyError > completionHandler)
 Retrieves the current user profile with access levels, subscriptions, and other information.
static void Identify (string customerUserId, Action< AdaptyError > completionHandler)
 Identifies the user with their user ID in your system.
static void Identify (string customerUserId, Guid iosAppAccountToken, string androidObfuscatedAccountId, Action< AdaptyError > completionHandler)
 Identifies the user with their user ID and platform-specific account identifiers.
static void IsActivated (Action< bool, AdaptyError > completionHandler)
 Checks if the native Adapty SDK is activated and ready to use.
static void GetLoglevel (Action< AdaptyLogLevel, AdaptyError > completionHandler)
 Returns the current log level of the Adapty SDK.
static void SetLogLevel (AdaptyLogLevel level, Action< AdaptyError > completionHandler)
 Sets the log level for the Adapty SDK.
static void GetCurrentInstallationStatus (Action< AdaptyInstallationStatus, AdaptyError > completionHandler)
 Returns the current installation status of the app.
static void Logout (Action< AdaptyError > completionHandler)
 Logs out the current user and clears the local profile data.
static void CreateWebPaywallUrl (AdaptyPaywall paywall, Action< string, AdaptyError > completionHandler)
 Creates a web URL for the paywall that can be used to display the paywall in a web view or browser.
static void CreateWebPaywallUrl (AdaptyPaywallProduct product, Action< string, AdaptyError > completionHandler)
 Creates a web URL for a specific product that can be used to display the purchase page in a web view or browser.
static void OpenWebPaywall (AdaptyPaywall paywall, Action< AdaptyError > completionHandler)
 Opens the paywall in a web view or browser.
static void OpenWebPaywall (AdaptyPaywallProduct product, Action< AdaptyError > completionHandler)
 Opens the product purchase page in a web view or browser.
static void LogShowPaywall (AdaptyPaywall paywall, Action< AdaptyError > completionHandler)
 Call this method to notify Adapty SDK, that particular paywall was shown to user.
static void UpdateAppStoreCollectingRefundDataConsent (Boolean consent, Action< AdaptyError > completionHandler)
 Updates the current user's refund data collection consent for App Store purchases.
static void UpdateAppStoreRefundPreference (AdaptyRefundPreference refundPreference, Action< AdaptyError > completionHandler)
 Sets the refund preference individually for the current user.
static void MakePurchase (AdaptyPaywallProduct product, AdaptyPurchaseParameters purchaseParameters, Action< AdaptyPurchaseResult, AdaptyError > completionHandler)
 Makes a purchase for the specified product.
static void PresentCodeRedemptionSheet (Action< AdaptyError > completionHandler)
 Presents the App Store code redemption sheet, enabling the user to redeem promotional codes.
static void ReportTransaction (string transactionId, string variationId, Action< AdaptyError > completionHandler)
 Reports a transaction to Adapty in Observer mode.
static void RestorePurchases (Action< AdaptyProfile, AdaptyError > completionHandler)
 Restores previous purchases made by the user.
static void GetNativeSDKVersion (Action< string, AdaptyError > completionHandler)
 Returns the version of the native Adapty SDK (iOS or Android).
static void SetFallback (string fileName, Action< AdaptyError > completionHandler)
 Sets fallback paywalls that will be used when there's no internet connection or when the Adapty backend is unavailable.
static void SetFallbackPaywalls (string fileName, Action< AdaptyError > completionHandler)
static void SetIntegrationIdentifier (string key, string value, Action< AdaptyError > completionHandler)
 Sets integration identifiers for the profile to integrate with third-party analytics and attribution services.
static void UpdateAttribution (string jsonString, string source, Action< AdaptyError > completionHandler)
 Updates attribution data for the profile to track user acquisition sources.
static void UpdateProfile (AdaptyProfileParameters param, Action< AdaptyError > completionHandler)
 Updates the user profile with optional attributes such as email, phone number, name, etc.
static void GetPaywallForDefaultAudience (string placementId, Action< AdaptyPaywall, AdaptyError > completionHandler)
 This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetPaywallForDefaultAudience (string placementId, AdaptyPlacementFetchPolicy fetchPolicy, Action< AdaptyPaywall, AdaptyError > completionHandler)
 This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetPaywallForDefaultAudience (string placementId, string locale, Action< AdaptyPaywall, AdaptyError > completionHandler)
 This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetOnboardingForDefaultAudience (string placementId, string locale, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetOnboardingForDefaultAudience (string placementId, AdaptyPlacementFetchPolicy fetchPolicy, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetOnboardingForDefaultAudience (string placementId, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.
static void GetOnboarding (string placementId, Action< AdaptyOnboarding, AdaptyError > completionHandler)
 Adapty allows you remotely configure onboarding screens that will be displayed in your app.
static void MakePurchase (AdaptyPaywallProduct product, Action< AdaptyPurchaseResult, AdaptyError > completionHandler)
 Makes a purchase for the specified product.
static void ReportTransaction (string transactionId, Action< AdaptyError > completionHandler)
 Reports a transaction to Adapty in Observer mode.
static void UpdateAttribution (Dictionary< string, dynamic > attribution, string source, Action< AdaptyError > completionHandler)
 Updates attribution data for the profile to track user acquisition sources.
static void SetEventListener (AdaptyEventListener listener)
 Sets the event listener for Adapty SDK events.
static void SetPaywallsEventsListener (AdaptyPaywallsEventsListener listener)
 Sets the event listener for paywall view events.
static void SetOnboardingsEventsListener (AdaptyOnboardingsEventsListener listener)
 Sets the event listener for onboarding view events.

Static Public Attributes

static readonly string SDKVersion = "3.14.0"
 The version of the Adapty SDK.

Static Package Functions

static void OnMessage (string id, string json)

Static Private Attributes

static AdaptyEventListener m_Listener
static AdaptyPaywallsEventsListener m_PaywallsEventsListener
static AdaptyOnboardingsEventsListener m_OnboardingsEventsListener

Detailed Description

The main class for interacting with the Adapty SDK.

Member Function Documentation

◆ Activate() [1/2]

void AdaptySDK.Adapty.Activate ( AdaptyConfiguration configuration,
Action< AdaptyError > completionHandler )
static

Use this method to initialize the Adapty SDK.

Parameters
configurationThe configuration to use for the SDK.
completionHandlerThe action that will be called with the result.

◆ Activate() [2/2]

void AdaptySDK.Adapty.Activate ( AdaptyConfiguration.Builder configurationBuilder,
Action< AdaptyError > completionHandler )
static

Use this method to initialize the Adapty SDK.

Parameters
configurationBuilderThe builder to use for the configuration.
completionHandlerThe action that will be called with the result.

◆ CreateWebPaywallUrl() [1/2]

void AdaptySDK.Adapty.CreateWebPaywallUrl ( AdaptyPaywall paywall,
Action< string, AdaptyError > completionHandler )
static

Creates a web URL for the paywall that can be used to display the paywall in a web view or browser.

This is useful for platforms that don't support native paywall views or for web-based implementations. Read more at Adapty Documentation

Parameters
paywallAn AdaptyPaywall object for which to create the web URL.
completionHandlerThe action that will be called with the result. The result contains the web URL string.

◆ CreateWebPaywallUrl() [2/2]

void AdaptySDK.Adapty.CreateWebPaywallUrl ( AdaptyPaywallProduct product,
Action< string, AdaptyError > completionHandler )
static

Creates a web URL for a specific product that can be used to display the purchase page in a web view or browser.

This is useful for platforms that don't support native purchase flows or for web-based implementations. Read more at Adapty Documentation

Parameters
productAn AdaptyPaywallProduct object for which to create the web URL.
completionHandlerThe action that will be called with the result. The result contains the web URL string.

◆ GetCurrentInstallationStatus()

void AdaptySDK.Adapty.GetCurrentInstallationStatus ( Action< AdaptyInstallationStatus, AdaptyError > completionHandler)
static

Returns the current installation status of the app.

This method provides information about whether the app installation status has been determined. Read more at Adapty Documentation

Parameters
completionHandlerThe action that will be called with the result. The result contains an AdaptyInstallationStatus object.

◆ GetLoglevel()

void AdaptySDK.Adapty.GetLoglevel ( Action< AdaptyLogLevel, AdaptyError > completionHandler)
static

Returns the current log level of the Adapty SDK.

Parameters
completionHandlerThe action that will be called with the result. The result contains the current AdaptyLogLevel value.

◆ GetNativeSDKVersion()

void AdaptySDK.Adapty.GetNativeSDKVersion ( Action< string, AdaptyError > completionHandler)
static

Returns the version of the native Adapty SDK (iOS or Android).

This method returns the version string of the underlying native SDK, which may differ from the Unity wrapper version.

Parameters
completionHandlerThe action that will be called with the result. The result contains the native SDK version string.

◆ GetOnboarding() [1/2]

void AdaptySDK.Adapty.GetOnboarding ( string placementId,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

Adapty allows you remotely configure onboarding screens that will be displayed in your app.

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
completionHandlerThe action that will be called with the result.

◆ GetOnboarding() [2/2]

void AdaptySDK.Adapty.GetOnboarding ( string placementId,
string locale,
AdaptyPlacementFetchPolicy fetchPolicy,
TimeSpan? loadTimeout,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

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

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the onboarding localization.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
loadTimeoutThe timeout for the onboarding loading.
completionHandlerThe action that will be called with the result.

◆ GetOnboardingForDefaultAudience() [1/4]

void AdaptySDK.Adapty.GetOnboardingForDefaultAudience ( string placementId,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
completionHandlerThe action that will be called with the result.

◆ GetOnboardingForDefaultAudience() [2/4]

void AdaptySDK.Adapty.GetOnboardingForDefaultAudience ( string placementId,
AdaptyPlacementFetchPolicy fetchPolicy,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
completionHandlerThe action that will be called with the result.

◆ GetOnboardingForDefaultAudience() [3/4]

void AdaptySDK.Adapty.GetOnboardingForDefaultAudience ( string placementId,
string locale,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the onboarding localization.
completionHandlerThe action that will be called with the result.

◆ GetOnboardingForDefaultAudience() [4/4]

void AdaptySDK.Adapty.GetOnboardingForDefaultAudience ( string placementId,
string locale,
AdaptyPlacementFetchPolicy fetchPolicy,
Action< AdaptyOnboarding, AdaptyError > completionHandler )
static

This method enables you to retrieve the onboarding from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the onboarding localization.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
completionHandlerThe action that will be called with the result.

◆ GetPaywall() [1/4]

void AdaptySDK.Adapty.GetPaywall ( string placementId,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

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.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
completionHandlerThe action that will be called with the result.

◆ GetPaywall() [2/4]

void AdaptySDK.Adapty.GetPaywall ( string placementId,
AdaptyPlacementFetchPolicy fetchPolicy,
TimeSpan? loadTimeout,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

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.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
loadTimeoutThe timeout for the paywall loading.
completionHandlerThe action that will be called with the result.

◆ GetPaywall() [3/4]

void AdaptySDK.Adapty.GetPaywall ( string placementId,
string locale,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

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.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the paywall localization.
completionHandlerThe action that will be called with the result.

◆ GetPaywall() [4/4]

void AdaptySDK.Adapty.GetPaywall ( string placementId,
string locale,
AdaptyPlacementFetchPolicy fetchPolicy,
TimeSpan? loadTimeout,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

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.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the paywall localization.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
loadTimeoutThe timeout for the paywall loading.
completionHandlerThe action that will be called with the result.

◆ GetPaywallForDefaultAudience() [1/4]

void AdaptySDK.Adapty.GetPaywallForDefaultAudience ( string placementId,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
completionHandlerThe action that will be called with the result.

◆ GetPaywallForDefaultAudience() [2/4]

void AdaptySDK.Adapty.GetPaywallForDefaultAudience ( string placementId,
AdaptyPlacementFetchPolicy fetchPolicy,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
completionHandlerThe action that will be called with the result.

◆ GetPaywallForDefaultAudience() [3/4]

void AdaptySDK.Adapty.GetPaywallForDefaultAudience ( string placementId,
string locale,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the paywall localization.
completionHandlerThe action that will be called with the result.

◆ GetPaywallForDefaultAudience() [4/4]

void AdaptySDK.Adapty.GetPaywallForDefaultAudience ( string placementId,
string locale,
AdaptyPlacementFetchPolicy fetchPolicy,
Action< AdaptyPaywall, AdaptyError > completionHandler )
static

This method enables you to retrieve the paywall from the Default Audience without having to wait for the Adapty SDK to send all the user information required for segmentation to the server.

Read more at Adapty Documentation

Parameters
placementIdThe identifier of the desired placement. This is the value you specified when you created the placement in the Adapty Dashboard.
localeThe identifier of the paywall localization.
fetchPolicyBy default SDK will try to load data from server and will return cached data in case of failure. Otherwise use .returnCacheDataElseLoad to return cached data if it exists.
completionHandlerThe action that will be called with the result.

◆ GetPaywallProducts()

void AdaptySDK.Adapty.GetPaywallProducts ( AdaptyPaywall paywall,
Action< IList< AdaptyPaywallProduct >, AdaptyError > completionHandler )
static

Fetches the products array for a given paywall.

Once you have an AdaptyPaywall, use this method to fetch the corresponding products with full pricing and subscription information. Read more at Adapty Documentation

Parameters
paywallAn AdaptyPaywall for which you want to get the products.
completionHandlerThe action that will be called with the result. The result contains a list of AdaptyPaywallProduct objects.

◆ GetProfile()

void AdaptySDK.Adapty.GetProfile ( Action< AdaptyProfile, AdaptyError > completionHandler)
static

Retrieves the current user profile with access levels, subscriptions, and other information.

The GetProfile method provides the most up-to-date result as it always tries to query the API. If for some reason (e.g., no internet connection), the Adapty SDK fails to retrieve information from the server, the data from cache will be returned. It is also important to note that the Adapty SDK updates the AdaptyProfile cache on a regular basis to keep this information as up-to-date as possible. Read more at Adapty Documentation

Parameters
completionHandlerThe action that will be called with the result. The result contains an AdaptyProfile object.

◆ Identify() [1/2]

void AdaptySDK.Adapty.Identify ( string customerUserId,
Action< AdaptyError > completionHandler )
static

Identifies the user with their user ID in your system.

If you don't have a user ID in the SDK configuration, you can set it later at any time with this method. The most common cases are after registration/authorization when the user switches from being an anonymous user to an authenticated user. Read more at Adapty Documentation

Parameters
customerUserIdThe user identifier in your system.
completionHandlerThe action that will be called with the result.

◆ Identify() [2/2]

void AdaptySDK.Adapty.Identify ( string customerUserId,
Guid iosAppAccountToken,
string androidObfuscatedAccountId,
Action< AdaptyError > completionHandler )
static

Identifies the user with their user ID and platform-specific account identifiers.

If you don't have a user ID in the SDK configuration, you can set it later at any time with this method. The most common cases are after registration/authorization when the user switches from being an anonymous user to an authenticated user. This overload allows you to provide platform-specific account identifiers for better purchase tracking. Read more at Adapty Documentation

Parameters
customerUserIdThe user identifier in your system.
iosAppAccountTokenThe UUID that you generate to associate a customer's In-App Purchase with its resulting App Store transaction (iOS only). Read more at Apple Documentation.
androidObfuscatedAccountIdThe obfuscated account identifier (Android only). Read more at Android Documentation.
completionHandlerThe action that will be called with the result.

◆ IsActivated()

void AdaptySDK.Adapty.IsActivated ( Action< bool, AdaptyError > completionHandler)
static

Checks if the native Adapty SDK is activated and ready to use.

Parameters
completionHandlerThe action that will be called with the result. The result contains a boolean value indicating whether the SDK is activated.

◆ Logout()

void AdaptySDK.Adapty.Logout ( Action< AdaptyError > completionHandler)
static

Logs out the current user and clears the local profile data.

After calling this method, the SDK will create a new anonymous profile for the next user session. Read more at Adapty Documentation

Parameters
completionHandlerThe action that will be called with the result.

◆ LogShowPaywall()

void AdaptySDK.Adapty.LogShowPaywall ( AdaptyPaywall paywall,
Action< AdaptyError > completionHandler )
static

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

Adapty helps you to measure the performance of the paywalls. We automatically collect all the metrics related to purchases except for paywall views. This is because only you know when the paywall was shown to a customer. Whenever you show a paywall to your user, call .logShowPaywall(paywall) to log the event, and it will be accumulated in the paywall metrics. Read more on the Adapty Documentation

Parameters
paywallAn [AdaptyPaywall] object.
completionHandlerThe action that will be called with the result.

◆ MakePurchase() [1/2]

void AdaptySDK.Adapty.MakePurchase ( AdaptyPaywallProduct product,
Action< AdaptyPurchaseResult, AdaptyError > completionHandler )
static

Makes a purchase for the specified product.

This method initiates the purchase flow for a product. The result contains information about the purchase status. Read more on the Adapty Documentation

Parameters
productAn AdaptyPaywallProduct object retrieved from the paywall.
completionHandlerThe action that will be called with the result. The result contains an AdaptyPurchaseResult object.

◆ MakePurchase() [2/2]

void AdaptySDK.Adapty.MakePurchase ( AdaptyPaywallProduct product,
AdaptyPurchaseParameters purchaseParameters,
Action< AdaptyPurchaseResult, AdaptyError > completionHandler )
static

Makes a purchase for the specified product.

This method initiates the purchase flow for a product. The result contains information about the purchase status. Read more on the Adapty Documentation

Parameters
productAn AdaptyPaywallProduct object retrieved from the paywall.
purchaseParametersAn optional AdaptyPurchaseParameters object containing purchase configuration (e.g., subscription update parameters for Android, offer personalization, etc.).
completionHandlerThe action that will be called with the result. The result contains an AdaptyPurchaseResult object.

◆ OnMessage()

void AdaptySDK.Adapty.OnMessage ( string id,
string json )
staticpackage

◆ OpenWebPaywall() [1/2]

void AdaptySDK.Adapty.OpenWebPaywall ( AdaptyPaywall paywall,
Action< AdaptyError > completionHandler )
static

Opens the paywall in a web view or browser.

This method opens the web paywall URL in the default browser or web view. Read more at Adapty Documentation

Parameters
paywallAn AdaptyPaywall object to open.
completionHandlerThe action that will be called with the result.

◆ OpenWebPaywall() [2/2]

void AdaptySDK.Adapty.OpenWebPaywall ( AdaptyPaywallProduct product,
Action< AdaptyError > completionHandler )
static

Opens the product purchase page in a web view or browser.

This method opens the web purchase URL for the specific product in the default browser or web view. Read more at Adapty Documentation

Parameters
productAn AdaptyPaywallProduct object to open.
completionHandlerThe action that will be called with the result.

◆ PresentCodeRedemptionSheet()

void AdaptySDK.Adapty.PresentCodeRedemptionSheet ( Action< AdaptyError > completionHandler)
static

Presents the App Store code redemption sheet, enabling the user to redeem promotional codes.

This method is iOS-only and presents the native App Store code redemption interface. Read more at Apple Documentation

Parameters
completionHandlerThe action that will be called with the result.

◆ ReportTransaction() [1/2]

void AdaptySDK.Adapty.ReportTransaction ( string transactionId,
Action< AdaptyError > completionHandler )
static

Reports a transaction to Adapty in Observer mode.

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

Parameters
transactionIdA string identifier of your purchased transaction. For iOS, use the transaction identifier from SKPaymentTransaction. For Android, use the order ID from the purchase object (purchase.getOrderId()).
completionHandlerThe action that will be called with the result.

◆ ReportTransaction() [2/2]

void AdaptySDK.Adapty.ReportTransaction ( string transactionId,
string variationId,
Action< AdaptyError > completionHandler )
static

Reports a transaction to Adapty in Observer mode.

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

Parameters
transactionIdA string identifier of your purchased transaction. For iOS, use the transaction identifier from SKPaymentTransaction. For Android, use the order ID from the purchase object (purchase.getOrderId()).
variationIdAn optional string identifier of the variation. You can get it using the AdaptyPaywall.VariationId property of AdaptyPaywall.
completionHandlerThe action that will be called with the result.

◆ RestorePurchases()

void AdaptySDK.Adapty.RestorePurchases ( Action< AdaptyProfile, AdaptyError > completionHandler)
static

Restores previous purchases made by the user.

This method restores all previous purchases and returns an AdaptyProfile object containing information about access levels, subscriptions, and non-subscription purchases. Generally, you only need to check the access level status to determine whether the user has premium access to the app. Read more at Adapty Documentation

Parameters
completionHandlerThe action that will be called with the result. The result contains an AdaptyProfile object.

◆ SetEventListener()

void AdaptySDK.Adapty.SetEventListener ( AdaptyEventListener listener)
static

Sets the event listener for Adapty SDK events.

Parameters
listenerThe AdaptyEventListener implementation to receive events.

◆ SetFallback()

void AdaptySDK.Adapty.SetFallback ( string fileName,
Action< AdaptyError > completionHandler )
static

Sets fallback paywalls that will be used when there's no internet connection or when the Adapty backend is unavailable.

Adapty allows you to provide fallback paywalls that will be used when a user opens the app for the first time and there's no internet connection, or in the rare case when the Adapty backend is down and there's no cache on the device. You should pass exactly the same payload you're getting from the Adapty backend. You can copy it from the Adapty Dashboard. The fallback paywalls file should be placed in the StreamingAssets folder in your Unity project. Read more on the Adapty Documentation

Parameters
fileNameThe name of the fallback paywalls file. The file should be placed in the StreamingAssets folder in your Unity project.
completionHandlerThe action that will be called with the result.

◆ SetFallbackPaywalls()

void AdaptySDK.Adapty.SetFallbackPaywalls ( string fileName,
Action< AdaptyError > completionHandler )
static

◆ SetIntegrationIdentifier()

void AdaptySDK.Adapty.SetIntegrationIdentifier ( string key,
string value,
Action< AdaptyError > completionHandler )
static

Sets integration identifiers for the profile to integrate with third-party analytics and attribution services.

Integration identifiers allow you to link Adapty profiles with external services like analytics platforms or attribution providers.

Parameters
keyThe identifier key of the integration (e.g., "amplitude_user_id", "mixpanel_distinct_id").
valueThe value of the integration identifier.
completionHandlerThe action that will be called with the result.

◆ SetLogLevel()

void AdaptySDK.Adapty.SetLogLevel ( AdaptyLogLevel level,
Action< AdaptyError > completionHandler )
static

Sets the log level for the Adapty SDK.

Use this method to control the verbosity of SDK logging. Available levels include Error, Warn, Info, and Verbose.

Parameters
levelThe AdaptyLogLevel value to set.
completionHandlerThe action that will be called with the result.

◆ SetOnboardingsEventsListener()

void AdaptySDK.Adapty.SetOnboardingsEventsListener ( AdaptyOnboardingsEventsListener listener)
static

Sets the event listener for onboarding view events.

Parameters
listenerThe AdaptyOnboardingsEventsListener implementation to receive events.

◆ SetPaywallsEventsListener()

void AdaptySDK.Adapty.SetPaywallsEventsListener ( AdaptyPaywallsEventsListener listener)
static

Sets the event listener for paywall view events.

Parameters
listenerThe AdaptyPaywallsEventsListener implementation to receive events.

◆ UpdateAppStoreCollectingRefundDataConsent()

void AdaptySDK.Adapty.UpdateAppStoreCollectingRefundDataConsent ( Boolean consent,
Action< AdaptyError > completionHandler )
static

Updates the current user's refund data collection consent for App Store purchases.

This method is iOS-only and allows you to manage user consent for refund data collection. Read more on the Adapty Documentation

Parameters
consentA boolean value indicating whether the user gave consent for refund data collection.
completionHandlerThe action that will be called with the result.

◆ UpdateAppStoreRefundPreference()

void AdaptySDK.Adapty.UpdateAppStoreRefundPreference ( AdaptyRefundPreference refundPreference,
Action< AdaptyError > completionHandler )
static

Sets the refund preference individually for the current user.

This method is iOS-only and allows you to set how refunds should be handled for a specific user. Read more on the Adapty Documentation

Parameters
refundPreferenceThe AdaptyRefundPreference value to set.
completionHandlerThe action that will be called with the result.

◆ UpdateAttribution() [1/2]

void AdaptySDK.Adapty.UpdateAttribution ( Dictionary< string, dynamic > attribution,
string source,
Action< AdaptyError > completionHandler )
static

Updates attribution data for the profile to track user acquisition sources.

This method allows you to send attribution data from various sources (e.g., AppsFlyer, Adjust, Branch) to Adapty. Read more on the Adapty Documentation

Parameters
attributionA dictionary containing attribution (conversion) data from the attribution provider.
sourceThe source of attribution (e.g., "appsflyer", "adjust", "branch", "custom").
completionHandlerThe action that will be called with the result.

◆ UpdateAttribution() [2/2]

void AdaptySDK.Adapty.UpdateAttribution ( string jsonString,
string source,
Action< AdaptyError > completionHandler )
static

Updates attribution data for the profile to track user acquisition sources.

This method allows you to send attribution data from various sources (e.g., AppsFlyer, Adjust, Branch) to Adapty. Read more on the Adapty Documentation

Parameters
jsonStringA serialized JSON string containing attribution (conversion) data from the attribution provider.
sourceThe source of attribution (e.g., "appsflyer", "adjust", "branch", "custom").
completionHandlerThe action that will be called with the result.

◆ UpdateProfile()

void AdaptySDK.Adapty.UpdateProfile ( AdaptyProfileParameters param,
Action< AdaptyError > completionHandler )
static

Updates the user profile with optional attributes such as email, phone number, name, etc.

You can use these attributes to create user segments

or view them in the CRM. Use AdaptyProfileParameters.Builder to build the parameters object. Read more at Adapty Documentation

Parameters
paramAn AdaptyProfileParameters object containing the attributes to update. Use AdaptyProfileParameters.Builder to build this object.
completionHandlerThe action that will be called with the result.

Member Data Documentation

◆ m_Listener

AdaptyEventListener AdaptySDK.Adapty.m_Listener
staticprivate

◆ m_OnboardingsEventsListener

AdaptyOnboardingsEventsListener AdaptySDK.Adapty.m_OnboardingsEventsListener
staticprivate

◆ m_PaywallsEventsListener

AdaptyPaywallsEventsListener AdaptySDK.Adapty.m_PaywallsEventsListener
staticprivate

◆ SDKVersion

readonly string AdaptySDK.Adapty.SDKVersion = "3.14.0"
static

The version of the Adapty SDK.


The documentation for this class was generated from the following files: