Skip to content

Commit 212fffe

Browse files
committed
Merge branch 'release/RN-3.15' into develop
2 parents 2b0d7fb + 3e55105 commit 212fffe

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

versioned_docs/version-3.0/react-native-web-paywall.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ displayed_sidebar: sdkreactnative
1010
Before you begin, make sure you have [configured your web paywall in the dashboard](web-paywall.md) and installed Adapty SDK version 3.6.1 or later.
1111
:::
1212

13+
## Open web paywalls
14+
1315
If you are working with a paywall you developed yourself, you need to handle web paywalls using the SDK method. The `.openWebPaywall` method:
1416
1. Generates a unique URL allowing Adapty to link a specific paywall shown to a particular user to the web page they are redirected to.
1517
2. Tracks when your users return to the app and then requests `.getProfile` at short intervals to determine whether the profile access rights have been updated.
@@ -40,3 +42,29 @@ There are two versions of the `openWebPaywall` method:
4042
| AdaptyError.productWithoutPurchaseUrl | The product doesn't have a web purchase URL | Verify the product configuration in the Adapty Dashboard |
4143
| AdaptyError.failedOpeningWebPaywallUrl | Failed to open the URL in the browser | Check device settings or provide an alternative purchase method |
4244
| AdaptyError.failedDecodingWebPaywallUrl | Failed to properly encode parameters in the URL | Verify URL parameters are valid and properly formatted |
45+
46+
## Open web paywalls in an in-app browser
47+
48+
:::important
49+
Opening web paywalls in an in-app browser is supported starting from Adapty SDK v. 3.15.
50+
:::
51+
52+
By default, web paywalls open in the external browser.
53+
54+
To provide a seamless user experience, you can open web paywalls in an in-app browser. This displays the web purchase page within your application, allowing users to complete transactions without switching apps.
55+
56+
To enable this, pass `WebPresentation.InAppBrowser` as the second argument to `openWebPaywall`:
57+
58+
```typescript showLineNumbers title="React Native (TSX)"
59+
import { adapty, WebPresentation } from 'react-native-adapty';
60+
61+
try {
62+
await adapty.openWebPaywall(
63+
product,
64+
WebPresentation.BrowserInApp, // default – WebPresentation.BrowserOutApp
65+
);
66+
} catch (error) {
67+
console.warn('Failed to open web paywall:', error);
68+
}
69+
70+
```

0 commit comments

Comments
 (0)