Controling Screen visibility

This section describes how to manage Screen's visibility

🚧

Minimum SDK versions

  • ReactNative: 4.0.1
  • Cordova: 4.1.0
  • Flutter: 4.0.0
  • Unity: 4.1.0

Overview

Managing the visibility of screens in your application is essential for providing a seamless user experience. The Purchasely SDK allows you to control the visibility of screens, enabling you to:

  • Hide a Screen.
  • Show again a hidden Screen.
  • Close permanently a Screen.

To learn more about fetching and displaying screens using the Purchasely SDK, refer to the displaying screens documentation.

Implementation

Hide a Screen

Use Purchasely.hidePresentation() to hide a screen without closing it. This method is useful when you want to temporarily hide the screen and bring it back later.

Purchasely.hidePresentation()
Purchasely.hidePresentation()
Purchasely.hidePresentation()
private PurchaselyRuntime.Purchasely _purchasely

_purchasely.HidePresentation()

Show a Screen

Use Purchasely.showPresentation() to display a screen that was previously hidden using hidePresentation().

Purchasely.showPresentation()
Purchasely.showPresentation()
Purchasely.showPresentation()
private PurchaselyRuntime.Purchasely _purchasely

_purchasely.ShowPresentation()

Close a Screen

Use Purchasely.closePresentation() to close the current screen permanently. If you want to display the screen again after closing it, you will have to fetch it again by calling fetchPresentation method.

Purchasely.closePresentation()
Purchasely.closePresentation()
Purchasely.closePresentation()
private PurchaselyRuntime.Purchasely _purchasely

_purchasely.ClosePresentation()

What’s Next

Learn how to customize your Screens by nesting multiple views