AdaptySDK 4.4.0
Loading...
Searching...
No Matches
AdaptySDK.AdaptyUI Class Reference

Building, presenting and dismissing the views that render a flow. More...

Static Public Member Functions

static void CreateFlowView (AdaptyFlow flow, AdaptyUICreateFlowViewParameters optionalParameters, Action< AdaptyUIFlowView, AdaptyError > completionHandler)
 Creates a flow view from an AdaptyFlow object.
static void DismissFlowView (AdaptyUIFlowView view, bool destroy, Action< AdaptyError > completionHandler)
 Dismisses the flow view, and releases it unless asked to keep it.
static void DestroyFlowView (AdaptyUIFlowView view, Action< AdaptyError > completionHandler)
 Releases a flow view kept by DismissFlowView(AdaptyUIFlowView, bool, Action<AdaptyError>) with destroy false.
static void SendAppMessage (AdaptyUIFlowView view, IReadOnlyDictionary< string, object > payload, Action< AdaptyError > completionHandler)
 Sends an object to the script of a flow view, which receives it as the applicationMsg event.
static void PresentFlowView (AdaptyUIFlowView view, Action< AdaptyError > completionHandler)
 Call this function if you wish to present the view.
static void PresentFlowView (AdaptyUIFlowView view, AdaptyUIIOSPresentationStyle iosPresentationStyle, Action< AdaptyError > completionHandler)
 Call this function if you wish to present the view.
static void ShowDialog (AdaptyUIFlowView view, AdaptyUIDialogConfiguration configuration, Action< AdaptyUIDialogActionType, AdaptyError > completionHandler)
 Presents a dialog on the flow view.
static void OpenUrl (string url, AdaptyWebPresentation openIn, Action< AdaptyError > completionHandler)
 Opens the URL natively, honoring the presentation option.
static void RequestAppReview (Action< AdaptyError > completionHandler)
 Requests a native store review prompt (App Store / Google Play in-app review).
static void CreateFlowView (AdaptyFlow flow, Action< AdaptyUIFlowView, AdaptyError > completionHandler)
 Creates a flow view from an AdaptyFlow object.
static void DismissFlowView (AdaptyUIFlowView view, Action< AdaptyError > completionHandler)
 Dismisses the flow view and releases it.
static void CreateOnboardingView (AdaptyOnboarding onboarding, AdaptyWebPresentation externalUrlsPresentation, Action< AdaptyUIOnboardingView, AdaptyError > completionHandler)
 Creates an onboarding view from an AdaptyOnboarding object.
static void PresentOnboardingView (AdaptyUIOnboardingView view, Action< AdaptyError > completionHandler)
 Presents the onboarding view to the user.
static void PresentOnboardingView (AdaptyUIOnboardingView view, AdaptyUIIOSPresentationStyle iosPresentationStyle, Action< AdaptyError > completionHandler)
 Presents the onboarding view to the user with a specified presentation style.
static void DismissOnboardingView (AdaptyUIOnboardingView view, Action< AdaptyError > completionHandler)
 Dismisses the onboarding view.
static void ShowDialog (AdaptyUIOnboardingView view, AdaptyUIDialogConfiguration configuration, Action< AdaptyUIDialogActionType, AdaptyError > completionHandler)
 Presents a dialog on the onboarding view.
static void CreateOnboardingView (AdaptyOnboarding onboarding, Action< AdaptyUIOnboardingView, AdaptyError > completionHandler)
 Creates an onboarding view from an AdaptyOnboarding object.

Detailed Description

Building, presenting and dismissing the views that render a flow.

Member Function Documentation

◆ CreateFlowView() [1/2]

void AdaptySDK.AdaptyUI.CreateFlowView ( AdaptyFlow flow,
Action< AdaptyUIFlowView, AdaptyError > completionHandler )
static

Creates a flow view from an AdaptyFlow object.

Right after receiving an AdaptyFlow, you can create the corresponding AdaptyUIFlowView to present it afterwards. Read more at Adapty Documentation

Parameters
flowAn AdaptyFlow object for which you are trying to create a view.
completionHandlerThe action that will be called with the result. The result contains an AdaptyUIFlowView object.

◆ CreateFlowView() [2/2]

void AdaptySDK.AdaptyUI.CreateFlowView ( AdaptyFlow flow,
AdaptyUICreateFlowViewParameters optionalParameters,
Action< AdaptyUIFlowView, AdaptyError > completionHandler )
static

Creates a flow view from an AdaptyFlow object.

Right after receiving an AdaptyFlow, you can create the corresponding AdaptyUIFlowView to present it afterwards. Read more at Adapty Documentation

Parameters
flowAn AdaptyFlow object for which you are trying to create a view.
optionalParametersAn optional AdaptyUICreateFlowViewParameters object that contains optional parameters like load timeout, custom tags, custom timers, product purchase parameters, and custom assets.
completionHandlerThe action that will be called with the result. The result contains an AdaptyUIFlowView object.

◆ CreateOnboardingView() [1/2]

void AdaptySDK.AdaptyUI.CreateOnboardingView ( AdaptyOnboarding onboarding,
Action< AdaptyUIOnboardingView, AdaptyError > completionHandler )
static

Creates an onboarding view from an AdaptyOnboarding object.

Parameters
onboardingAn AdaptyOnboarding object for which you are trying to create a view.
completionHandlerThe action that will be called with the result. The result contains an AdaptyUIOnboardingView object.

◆ CreateOnboardingView() [2/2]

void AdaptySDK.AdaptyUI.CreateOnboardingView ( AdaptyOnboarding onboarding,
AdaptyWebPresentation externalUrlsPresentation,
Action< AdaptyUIOnboardingView, AdaptyError > completionHandler )
static

Creates an onboarding view from an AdaptyOnboarding object.

Right after receiving an AdaptyOnboarding, you can create the corresponding AdaptyUIOnboardingView to present it afterwards. Read more at Adapty Documentation

Parameters
onboardingAn AdaptyOnboarding object for which you are trying to create a view.
externalUrlsPresentationControls how external URLs are presented in the onboarding (in-app browser vs external browser). Default is AdaptyWebPresentation.ExternalBrowser.
completionHandlerThe action that will be called with the result. The result contains an AdaptyUIOnboardingView object.

◆ DestroyFlowView()

void AdaptySDK.AdaptyUI.DestroyFlowView ( AdaptyUIFlowView view,
Action< AdaptyError > completionHandler )
static

Releases a flow view kept by DismissFlowView(AdaptyUIFlowView, bool, Action<AdaptyError>) with destroy false.

A view still on screen is dismissed first. Any call on a released view fails with AdaptyErrorCode.WrongParam: the view is not found.

Parameters
viewAn AdaptyUIFlowView object representing the view to release.
completionHandlerThe action that will be called with the result.

◆ DismissFlowView() [1/2]

void AdaptySDK.AdaptyUI.DismissFlowView ( AdaptyUIFlowView view,
Action< AdaptyError > completionHandler )
static

Dismisses the flow view and releases it.

A released view cannot be presented again. To keep it for another presentation, use DismissFlowView(AdaptyUIFlowView, bool, Action<AdaptyError>).

Parameters
viewAn AdaptyUIFlowView object representing the view to dismiss.
completionHandlerThe action that will be called with the result.

◆ DismissFlowView() [2/2]

void AdaptySDK.AdaptyUI.DismissFlowView ( AdaptyUIFlowView view,
bool destroy,
Action< AdaptyError > completionHandler )
static

Dismisses the flow view, and releases it unless asked to keep it.

A released view cannot be presented again — create a new one via CreateFlowView(AdaptyFlow, AdaptyUICreateFlowViewParameters, Action<AdaptyUIFlowView, AdaptyError>). A kept view (destroy false) can be presented again with PresentFlowView(AdaptyUIFlowView, Action<AdaptyError>) and resumes where it was; its events keep arriving with the same AdaptyUIFlowView.Id. It stays in memory until DestroyFlowView(AdaptyUIFlowView, Action<AdaptyError>) is called, so call it once the view is no longer needed.

Parameters
viewAn AdaptyUIFlowView object representing the view to dismiss.
destroyWhether to release the view once it is dismissed.
completionHandlerThe action that will be called with the result.

◆ DismissOnboardingView()

void AdaptySDK.AdaptyUI.DismissOnboardingView ( AdaptyUIOnboardingView view,
Action< AdaptyError > completionHandler )
static

Dismisses the onboarding view.

Call this method when you want to dismiss the onboarding view from the screen.

Parameters
viewAn AdaptyUIOnboardingView object representing the view to dismiss.
completionHandlerThe action that will be called with the result.

◆ OpenUrl()

void AdaptySDK.AdaptyUI.OpenUrl ( string url,
AdaptyWebPresentation openIn,
Action< AdaptyError > completionHandler )
static

Opens the URL natively, honoring the presentation option.

This is the same handling the SDK applies by default to open_url user actions. Use it when you override IAdaptyFlowsEventsListener.FlowViewDidPerformAction(AdaptyUIFlowView, AdaptyUIUserAction) and want to keep the default URL behavior.

Parameters
urlThe URL 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.

◆ PresentFlowView() [1/2]

void AdaptySDK.AdaptyUI.PresentFlowView ( AdaptyUIFlowView view,
Action< AdaptyError > completionHandler )
static

Call this function if you wish to present the view.

Parameters
viewan [AdaptyUIFlowView] object, for which is representing the view.
completionHandlerThe action that will be called with the result.

◆ PresentFlowView() [2/2]

void AdaptySDK.AdaptyUI.PresentFlowView ( AdaptyUIFlowView view,
AdaptyUIIOSPresentationStyle iosPresentationStyle,
Action< AdaptyError > completionHandler )
static

Call this function if you wish to present the view.

Parameters
viewan [AdaptyUIFlowView] object, for which is representing the view.
iosPresentationStylean [AdaptyUIIOSPresentationStyle] object, for which is representing the iOS presentation style.
completionHandlerThe action that will be called with the result.

◆ PresentOnboardingView() [1/2]

void AdaptySDK.AdaptyUI.PresentOnboardingView ( AdaptyUIOnboardingView view,
Action< AdaptyError > completionHandler )
static

Presents the onboarding view to the user.

This method presents the onboarding view using the default full-screen presentation style.

Parameters
viewAn AdaptyUIOnboardingView object representing the view to present.
completionHandlerThe action that will be called with the result.

◆ PresentOnboardingView() [2/2]

void AdaptySDK.AdaptyUI.PresentOnboardingView ( AdaptyUIOnboardingView view,
AdaptyUIIOSPresentationStyle iosPresentationStyle,
Action< AdaptyError > completionHandler )
static

Presents the onboarding view to the user with a specified presentation style.

This method presents the onboarding view using the specified iOS presentation style (iOS only).

Parameters
viewAn AdaptyUIOnboardingView object representing the view to present.
iosPresentationStyleAn AdaptyUIIOSPresentationStyle object representing the iOS presentation style (iOS only).
completionHandlerThe action that will be called with the result.

◆ RequestAppReview()

void AdaptySDK.AdaptyUI.RequestAppReview ( Action< AdaptyError > completionHandler)
static

Requests a native store review prompt (App Store / Google Play in-app review).

This is the same handling the SDK applies by default to the flow app review request. Use it when you override IAdaptyUISystemRequestsHandler.FlowViewDidRequestAppReview(AdaptyUIFlowView) and want to keep the default behavior.

Parameters
completionHandlerThe action that will be called with the result.

◆ SendAppMessage()

void AdaptySDK.AdaptyUI.SendAppMessage ( AdaptyUIFlowView view,
IReadOnlyDictionary< string, object > payload,
Action< AdaptyError > completionHandler )
static

Sends an object to the script of a flow view, which receives it as the applicationMsg event.

Once IAdaptyFlowsEventsListener.FlowViewDidAppear(AdaptyUIFlowView) has reported the view, a message is sure to arrive. On Android a message sent before the view was first presented, or after the SDK discarded the flow's state, is dropped and the call still succeeds; one sent after PresentFlowView(AdaptyUIFlowView, AdaptyUIIOSPresentationStyle, Action<AdaptyError>) while the script is still loading waits for it. Success means the message was passed to the flow, not that the script handled it; when the order matters, wait for each call to complete before sending the next. On iOS below 16 the call fails with AdaptyErrorCode.PlatformNotSupported, and for a view that is gone with AdaptyErrorCode.WrongParam. No id comes back: to match a reply from the script with a message, put an id of your own in the payload.

Parameters
viewThe flow view whose script receives the message.
payloadThe message: strings, booleans, numbers, nulls, lists and nested dictionaries with string keys. A graph that cannot be written as JSON, such as one that contains itself, fails the call with AdaptyErrorCode.WrongParam before anything is sent. NaN and infinities go as the strings "NaN", "Infinity" and "-Infinity".
completionHandlerThe action that will be called with the result.

◆ ShowDialog() [1/2]

void AdaptySDK.AdaptyUI.ShowDialog ( AdaptyUIFlowView view,
AdaptyUIDialogConfiguration configuration,
Action< AdaptyUIDialogActionType, AdaptyError > completionHandler )
static

Presents a dialog on the flow view.

This method shows a dialog with custom configuration on the flow view. The dialog can be used for various purposes like showing terms, privacy policy, or custom messages.

Parameters
viewAn AdaptyUIFlowView object representing the view on which to show the dialog.
configurationAn AdaptyUIDialogConfiguration object that contains the dialog configuration.
completionHandlerThe action that will be called with the result. The result contains the AdaptyUIDialogActionType indicating which action was taken.

◆ ShowDialog() [2/2]

void AdaptySDK.AdaptyUI.ShowDialog ( AdaptyUIOnboardingView view,
AdaptyUIDialogConfiguration configuration,
Action< AdaptyUIDialogActionType, AdaptyError > completionHandler )
static

Presents a dialog on the onboarding view.

This method shows a dialog with custom configuration on the onboarding view. The dialog can be used for various purposes like showing terms, privacy policy, or custom messages.

Parameters
viewAn AdaptyUIOnboardingView object representing the view on which to show the dialog.
configurationAn AdaptyUIDialogConfiguration object that contains the dialog configuration.
completionHandlerThe action that will be called with the result. The result contains the AdaptyUIDialogActionType indicating which action was taken.

The documentation for this class was generated from the following files:
  • Packages/com.adapty.unity-sdk/Runtime/Adapty.cs
  • Packages/com.adapty.unity-sdk/Runtime/Adapty.Overloads.cs
  • Packages/com.adapty.unity-sdk/Runtime/Obsolete/AdaptyUI.Obsolete.cs