AdaptySDK 4.1.1
Loading...
Searching...
No Matches
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 GetFlow (string placementId, Action< AdaptyFlow, 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 GetFlow (string placementId, AdaptyPlacementFetchPolicy fetchPolicy, TimeSpan? loadTimeout, Action< AdaptyFlow, 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 GetFlowForDefaultAudience (string placementId, AdaptyPlacementFetchPolicy fetchPolicy, Action< AdaptyFlow, AdaptyError > completionHandler)
 This method enables you to retrieve the flow 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 (AdaptyFlow flow, Action< IReadOnlyList< AdaptyPaywallProduct >, AdaptyError > completionHandler)
 Fetches the products array for a given flow.
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 (AdaptyFlowPaywall 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 (AdaptyFlowPaywall paywall, AdaptyWebPresentation openIn, Action< AdaptyError > completionHandler)
 Opens the paywall in a web view or browser.
static void OpenWebPaywall (AdaptyPaywallProduct product, AdaptyWebPresentation openIn, Action< AdaptyError > completionHandler)
 Opens the product purchase page in a web view or browser.
static void LogShowFlow (AdaptyFlow flow, Action< AdaptyError > completionHandler)
 Call this method to notify Adapty SDK, that particular flow 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 MakePromotedPurchase (AdaptyPromotedProduct product, Action< AdaptyPurchaseResult, AdaptyError > completionHandler)
 Completes a promoted purchase the user started from the App Store product page. iOS only.
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 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 UpdateExternalAttribution (string jsonString, AdaptyExternalAttributionProvider provider, Action< AdaptyError > completionHandler)
 Updates external 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 SetEventListener (IAdaptyEventListener listener)
 Sets the event listener for Adapty SDK events.
static void SetFlowsEventsListener (IAdaptyFlowsEventsListener listener)
 Sets the event listener for flow view events.
static void SetSystemRequestsHandler (IAdaptyUISystemRequestsHandler handler)
 Sets the handler for system requests initiated by a flow (OS permission prompts and store review requests).
static void SetObserverModeResolver (IAdaptyUIObserverModeResolver resolver)
 Sets the resolver for purchases and restores initiated by a flow while the SDK runs in Observer mode.
static void GetFlowForDefaultAudience (string placementId, Action< AdaptyFlow, AdaptyError > completionHandler)
 This method enables you to retrieve the flow 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 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 UpdateExternalAttribution (IReadOnlyDictionary< string, object > attribution, AdaptyExternalAttributionProvider provider, Action< AdaptyError > completionHandler)
 Updates external attribution data for the profile to track user acquisition sources.
static void OpenWebPaywall (AdaptyFlowPaywall 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 SetOnboardingsEventsListener (IAdaptyOnboardingsEventsListener listener)
 Sets the event listener for onboarding view events.
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 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 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 Public Attributes

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

Static Package Functions

static void ResetListeners ()
 With Domain Reload disabled, statics survive leaving Play Mode, so the listeners a previous run registered would still be here - and would receive the next run's events. Unity calls this before the first scene of every run.
static void InitializeTransport ()
 Registers the platform callback transport, before the first scene loads.
static void RunOnMainThread (Action action)
 Runs the action on the main thread: inline when the caller is already there, posted through the captured SynchronizationContext otherwise.
static void OnMessage (string id, string json)
 Entry point for every event the native side pushes.
static void ResetOnboardingsListener ()

Static Private Member Functions

static bool RequireEventListener (string eventId)
static bool RequireFlowsListener (string eventId)
static T Required< T > (JObject parameters, string key)
static T Optional< T > (JObject parameters, string key)
static void Dispatch (string id, JObject parameters)
static bool RequireOnboardingsListener (string eventId)
static void OnLegacyOnboardingMessage (string id, JObject parameters)
 Dispatches the events of the legacy onboarding API.

Static Private Attributes

static IAdaptyEventListener m_Listener
static IAdaptyFlowsEventsListener m_FlowsEventsListener
static IAdaptyUISystemRequestsHandler m_SystemRequestsHandler
static IAdaptyUIObserverModeResolver m_ObserverModeResolver
static SynchronizationContext m_MainThreadContext
static int m_MainThreadId = -1
static IAdaptyOnboardingsEventsListener 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 ( AdaptyFlowPaywall 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 AdaptyFlowPaywall 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.

◆ Dispatch()

void AdaptySDK.Adapty.Dispatch ( string id,
JObject parameters )
staticprivate

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

◆ GetFlow() [1/2]

void AdaptySDK.Adapty.GetFlow ( string placementId,
Action< AdaptyFlow, 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.

◆ GetFlow() [2/2]

void AdaptySDK.Adapty.GetFlow ( string placementId,
AdaptyPlacementFetchPolicy fetchPolicy,
TimeSpan? loadTimeout,
Action< AdaptyFlow, 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 flow loading.
completionHandlerThe action that will be called with the result.

◆ GetFlowForDefaultAudience() [1/2]

void AdaptySDK.Adapty.GetFlowForDefaultAudience ( string placementId,
Action< AdaptyFlow, AdaptyError > completionHandler )
static

This method enables you to retrieve the flow 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.

◆ GetFlowForDefaultAudience() [2/2]

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

This method enables you to retrieve the flow 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.

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

◆ GetPaywallProducts()

void AdaptySDK.Adapty.GetPaywallProducts ( AdaptyFlow flow,
Action< IReadOnlyList< AdaptyPaywallProduct >, AdaptyError > completionHandler )
static

Fetches the products array for a given flow.

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

Parameters
flowAn AdaptyFlow 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.

◆ InitializeTransport()

void AdaptySDK.Adapty.InitializeTransport ( )
staticpackage

Registers the platform callback transport, before the first scene loads.

Nothing native reaches C# until this has run: on iOS the bridge drops a completion while its delegate is null, and on Android the wrapper has no handler to post it to. It used to happen inside the listener setters, which made every completion handler depend on a subscription that is optional and unrelated. The stage covers the whole MonoBehaviour lifecycle, and it is what binds Android's handler to the scripting thread.

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

◆ LogShowFlow()

void AdaptySDK.Adapty.LogShowFlow ( AdaptyFlow flow,
Action< AdaptyError > completionHandler )
static

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

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

Parameters
flowAn [AdaptyFlow] object.
completionHandlerThe action that will be called with the result.

◆ MakePromotedPurchase()

void AdaptySDK.Adapty.MakePromotedPurchase ( AdaptyPromotedProduct product,
Action< AdaptyPurchaseResult, AdaptyError > completionHandler )
static

Completes a promoted purchase the user started from the App Store product page. iOS only.

Promoted in-app purchases are an App Store feature; on other platforms the completion handler reports an error. Read more on the Adapty Documentation

Parameters
productAn AdaptyPromotedProduct object received through IAdaptyEventListener.OnReceivePromotedPurchase(AdaptyPromotedProduct).
completionHandlerThe action that will be called with the result. The result contains an AdaptyPurchaseResult object.

◆ 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.
purchaseParametersAndroid only. An optional AdaptyPurchaseParameters object containing purchase configuration (e.g., subscription update parameters, offer personalization, etc.). Ignored on iOS.
completionHandlerThe action that will be called with the result. The result contains an AdaptyPurchaseResult object.

◆ OnLegacyOnboardingMessage()

void AdaptySDK.Adapty.OnLegacyOnboardingMessage ( string id,
JObject parameters )
staticprivate

Dispatches the events of the legacy onboarding API.

Split out of Dispatch so that the deprecation warnings it raises stay on this one method instead of on every case of the main switch.

◆ OnMessage()

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

Entry point for every event the native side pushes.

Nothing is allowed to escape. The call arrives from native code - on iOS through a reverse-P/Invoke callback with no handler behind it - so an exception here does not surface as a C# error, it takes the process down on IL2CPP. A malformed payload or a throwing listener is logged and the event is dropped.

◆ OpenWebPaywall() [1/4]

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

Opens the paywall in a web view or browser.

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

◆ OpenWebPaywall() [2/4]

void AdaptySDK.Adapty.OpenWebPaywall ( AdaptyFlowPaywall paywall,
AdaptyWebPresentation openIn,
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 AdaptyFlowPaywall object to open.
openInControls whether to open in external browser or in-app browser. Default is AdaptyWebPresentation.ExternalBrowser.
completionHandlerThe action that will be called with the result.

◆ OpenWebPaywall() [3/4]

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

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

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

◆ OpenWebPaywall() [4/4]

void AdaptySDK.Adapty.OpenWebPaywall ( AdaptyPaywallProduct product,
AdaptyWebPresentation openIn,
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.
openInControls whether to open in external browser or in-app browser. Default is AdaptyWebPresentation.ExternalBrowser.
completionHandlerThe action that will be called with the result.

◆ Optional< T >()

T AdaptySDK.Adapty.Optional< T > ( JObject parameters,
string key )
staticprivate

◆ 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. On other platforms the call does nothing and completes without an error. 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 AdaptyFlow.VariationId property of AdaptyFlow.
completionHandlerThe action that will be called with the result.

◆ Required< T >()

T AdaptySDK.Adapty.Required< T > ( JObject parameters,
string key )
staticprivate

◆ RequireEventListener()

bool AdaptySDK.Adapty.RequireEventListener ( string eventId)
staticprivate

◆ RequireFlowsListener()

bool AdaptySDK.Adapty.RequireFlowsListener ( string eventId)
staticprivate

◆ RequireOnboardingsListener()

bool AdaptySDK.Adapty.RequireOnboardingsListener ( string eventId)
staticprivate

◆ ResetListeners()

void AdaptySDK.Adapty.ResetListeners ( )
staticpackage

With Domain Reload disabled, statics survive leaving Play Mode, so the listeners a previous run registered would still be here - and would receive the next run's events. Unity calls this before the first scene of every run.

◆ ResetOnboardingsListener()

void AdaptySDK.Adapty.ResetOnboardingsListener ( )
staticpackage

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

◆ RunOnMainThread()

void AdaptySDK.Adapty.RunOnMainThread ( Action action)
staticpackage

Runs the action on the main thread: inline when the caller is already there, posted through the captured SynchronizationContext otherwise.

For the requests behind the delegates the SDK hands to app code - the permission respond and the observer-mode reports - which the app may invoke from any thread. On Android the bridge is JNI, and a thread Unity did not attach cannot enter it, so the hop is what makes "any thread" true off the main one. Without a captured context the action runs inline, which is where every call was made before the capture existed.

◆ SetEventListener()

void AdaptySDK.Adapty.SetEventListener ( IAdaptyEventListener listener)
static

Sets the event listener for Adapty SDK events.

Parameters
listenerThe IAdaptyEventListener implementation to receive events, or null to detach the previous one.

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

◆ SetFlowsEventsListener()

void AdaptySDK.Adapty.SetFlowsEventsListener ( IAdaptyFlowsEventsListener listener)
static

Sets the event listener for flow view events.

Parameters
listenerThe IAdaptyFlowsEventsListener implementation to receive events, or null to detach the previous one.

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

◆ SetObserverModeResolver()

void AdaptySDK.Adapty.SetObserverModeResolver ( IAdaptyUIObserverModeResolver resolver)
static

Sets the resolver for purchases and restores initiated by a flow while the SDK runs in Observer mode.

Parameters
resolverThe IAdaptyUIObserverModeResolver implementation to resolve purchases and restores, or null to detach the previous one.

◆ SetOnboardingsEventsListener()

void AdaptySDK.Adapty.SetOnboardingsEventsListener ( IAdaptyOnboardingsEventsListener listener)
static

Sets the event listener for onboarding view events.

Parameters
listenerThe IAdaptyOnboardingsEventsListener implementation to receive events, or null to detach the previous one.

◆ SetSystemRequestsHandler()

void AdaptySDK.Adapty.SetSystemRequestsHandler ( IAdaptyUISystemRequestsHandler handler)
static

Sets the handler for system requests initiated by a flow (OS permission prompts and store review requests).

Parameters
handlerThe IAdaptyUISystemRequestsHandler implementation to receive requests, or null to detach the previous one.

◆ 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. On other platforms the call does nothing and completes without an error. 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. On other platforms the call does nothing and completes without an error. Read more on the Adapty Documentation

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

◆ UpdateExternalAttribution() [1/2]

void AdaptySDK.Adapty.UpdateExternalAttribution ( IReadOnlyDictionary< string, object > attribution,
AdaptyExternalAttributionProvider provider,
Action< AdaptyError > completionHandler )
static

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

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

Parameters
attributionA dictionary containing attribution (conversion) data from the attribution provider. This overload is the default path; the string one is for providers that hand the data over already serialized.
providerThe external attribution provider: one of the AdaptyExternalAttributionProvider instances, or one constructed for a provider the backend added later.
completionHandlerThe action that will be called with the result.

◆ UpdateExternalAttribution() [2/2]

void AdaptySDK.Adapty.UpdateExternalAttribution ( string jsonString,
AdaptyExternalAttributionProvider provider,
Action< AdaptyError > completionHandler )
static

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

This method allows you to send attribution data from external providers (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. This overload is for providers that hand the data over already serialized — AppsFlyer's conversion data callback, for one; the dictionary overload is the default path.
providerThe external attribution provider: one of the AdaptyExternalAttributionProvider instances, or one constructed for a provider the backend added later.
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_FlowsEventsListener

IAdaptyFlowsEventsListener AdaptySDK.Adapty.m_FlowsEventsListener
staticprivate

◆ m_Listener

IAdaptyEventListener AdaptySDK.Adapty.m_Listener
staticprivate

◆ m_MainThreadContext

SynchronizationContext AdaptySDK.Adapty.m_MainThreadContext
staticprivate

◆ m_MainThreadId

int AdaptySDK.Adapty.m_MainThreadId = -1
staticprivate

◆ m_ObserverModeResolver

IAdaptyUIObserverModeResolver AdaptySDK.Adapty.m_ObserverModeResolver
staticprivate

◆ m_OnboardingsEventsListener

IAdaptyOnboardingsEventsListener AdaptySDK.Adapty.m_OnboardingsEventsListener
staticprivate

◆ m_SystemRequestsHandler

IAdaptyUISystemRequestsHandler AdaptySDK.Adapty.m_SystemRequestsHandler
staticprivate

◆ SDKVersion

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

The version of the Adapty SDK.


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