Skip to main content

Present onboardings in Unity SDK

If you've customized an onboarding using the builder, you don't need to worry about rendering it in your Unity app code to display it to the user. Such an onboarding contains both what should be shown within the onboarding and how it should be shown.

Before you start, ensure that:

  1. You have installed Adapty Unity SDK 3.14.0 or later.
  2. You have created an onboarding.
  3. You have added the onboarding to a placement.

To display an onboarding, use the view.Present() method on the view created by the CreateOnboardingView method. Each view can only be used once. If you need to display the paywall again, call CreateOnboardingView one more to create a new view instance.

warning

Reusing the same view without recreating it may result in an AdaptyUIError.viewAlreadyPresented error.

Unity
view.Present((presentError) => {
if (presentError != null) {
// handle the error
}
};

Configure iOS presentation style

Configure how the onboarding is presented on iOS by passing the iosPresentationStyle parameter to the Present() method. The parameter accepts AdaptyUIIOSPresentationStyle.FullScreen (default) or AdaptyUIIOSPresentationStyle.PageSheet values.

Unity
view.Present(AdaptyUIIOSPresentationStyle.PageSheet, (error) => {
// handle the error
});