Displaying Screens
This section describes how to manage the native views generated by the Purchasely SDK when displaying Screens
Native UIOur SDK create Screen with native iOS and Android components, UI Kit and Android Views, for the best performance and compatibility. As such, some limitations may apply with a bridge sdk.
Purchasely will provide a native view to display in your application, consequently you can completely customize its behavior and its allocated Screen space to decide for example if you want to display it in full mode or in a pop-in
Overview
The SDK returns a native view, so you decide how and where it is displayed (full screen, pop-in, nested…).
| Platform | What the SDK provides | Safe areas / insets | Close button |
|---|---|---|---|
| iOS | A native UIViewController — present it however you like | Not respected by default — you decide whether to display below or behind the notch | Rendered on top, automatically respects safe areas |
| Android | A native View — add it to your layout hierarchy (another View, a Fragment or an Activity) | Not respected by default — you decide below or behind the status & navigation bars | Rendered on top, automatically respects the top inset (portrait) and right inset (landscape) |
| Flutter / React Native / Cordova | A controller (iOS) / activity (Android) displayed on top of your Screen by default | Handled by the native layer | Managed by the SDK |
Screen VisibilityOn Flutter, React Native and Cordova, you can control the Screen visibility to hide the paywall and present it again later, or use Nested Views to embed a Purchasely Screen inside your own component.
Placements
As a general rule, you should always use a Placement to display a Purchasely Screen. This allows you to display a different Screen based on an Audience or an A/B test or just change it without updating your code.
Learn more about displaying Screen with placements
Pre-fetching
You can pre-fetch a Screen with the PLYPresentationBuilder / PLYPresentation { }.preload API (iOS: PLYPresentationBuilder.forPlacementId(...).build().preload { }, Android: PLYPresentation { placementId(...) }.preload { }) so that all processing is done before showing it to your user. You also get access to more information like the audience id or ab test variant id of your user for the placement you have requested.
However, we do not advise to pre-fetch all screens at once as an Audience is attributed on request based on user attributes or subscription status that may change during the session of the user. Thus, we suggest to pre-fetch at start only your home placement and then fetch the Placement of the current touchpoint/Screen of your application when the user navigates.
Lear more about pre-fetching Screens
Display your own dialogs
On Purchasely Screens in full mode, the SDK will automatically display dialogs (aka pop-ins) to inform the user about the status of his action like a successful purchase or an error in his request. Those dialogs are displayed in the native format of the device according to the UI guidelines of Apple and Google.
If you wish to change the layout of those dialogs or change the content, you can implement a PLYUIHandler to display them yourselves.
Display deeplinks yourself
If you have setup deeplinks with Purchasely, the SDK will automatically display them in a specific UIViewController (iOS) or Activity (Android).
However, you can display a Purchasely Screen yourself inside your own View if you implement a PLYUIHandler.
Updated about 21 hours ago

