Paywall Integration
Overview
Twinr allows you to integrate RevenueCat’s Paywall system directly into your app.
Using Twinr’s JavaScript bridge functions, you can:
- Present a RevenueCat paywall
- Show paywall only if entitlement is missing
- Restore previous purchases
- Trigger paywall from custom HTML buttons
This integration works only when:
- RevenueCat is selected as Purchase Provider
- RevenueCat API keys are configured
- The app is published
Configure Paywall Setup
Before using Twinr bridge functions, you must configure RevenueCat properly.
If using RevenueCat’s Hosted Paywall:
- Go to Paywalls
- Create a new Paywall
- Attach it to your Offering
- Customize:
- Layout
- Branding
- Pricing display
- Publish Paywall
Now the paywall is ready to be triggered via Twinr.
Available Paywall Functions
1️⃣ Present Paywall
Displays the offering paywall.
Code
twinr_present_paywall('default')
default = Offering Identifier
2️⃣ Present Paywall If Needed
Shows paywall only if entitlement is not active.
Code
twinr_present_paywall_if_needed('premium_access', 'default');
Parameters:
premium_access→ Entitlement Identifierdefault→ Offering Identifier
3️⃣ Restore Purchase
Required especially for iOS compliance.
Code
twinr_restore_purchase();
No parameters required.