Call function
paywall.open()
to open the paywall.Please note that the paywall will only open if the country targeting settings match, the trial period conditions are met and user don’t have active subscription or lifetime payment.
try { await paywall.open(props?: { resolveEvent: 'opened' | 'signed-in' | 'success-purchase' }); // paywall has status visible } catch (error) { // paywall has status invisible }
You can pass resolveEvent to have different promise resolutions:
RESOLVE EVENT | DESCRIPTION |
opened | The promise will be resolved when the paywall opens. |
signed-in | The promise will be resolved when user signed in. |
success-purchase | The promise will be resolved when user paid or restore purchase. |
By default, the paywall will open in fullscreen mode. To open it within a specific container, pass the paywallContainerId to window.paywall object in install script.