If you specified the display settings for the trigger in the paywall settings, you need to call the function
paywall.open()
to open the paywall. If you selected the immediately option, you don't need to call the function; the paywall will open as soon as it is initialized.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. |