Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9bf2819
Draft
eandreeva-twr Sep 9, 2025
fea8f4f
Platform view – RN
eandreeva-twr Sep 10, 2025
8f29770
Add a minimum version of RN
eandreeva-twr Sep 15, 2025
6f8402a
Rename registerEventHandlers to setEventHandlers
eandreeva-twr Sep 23, 2025
675fe3c
Merge branch 'ADP-4160' into ADP-4313
eandreeva-twr Sep 23, 2025
3de332b
Fix tabs
eandreeva-twr Sep 23, 2025
f87ee4a
Add a note about re-registering event handlers
eandreeva-twr Sep 25, 2025
54787a9
Add handling onboarding events
eandreeva-twr Sep 30, 2025
3d7fed8
Rename to fix
eandreeva-twr Sep 30, 2025
f2b4019
Rename to fix
eandreeva-twr Sep 30, 2025
0aced50
Add more to the migration guide
eandreeva-twr Sep 30, 2025
0e9e6b4
some updates
eandreeva-twr Sep 30, 2025
ccbc9ec
Fixes after review
eandreeva-twr Sep 30, 2025
8ecfa62
Fixes after review
eandreeva-twr Oct 1, 2025
538bd61
Fixes after review
eandreeva-twr Oct 1, 2025
e28b017
review migration to RN SDK v3.12 (#106)
StanislavMayorov Oct 2, 2025
c5976ec
Merge branch 'main' into ADP-4313
eandreeva-twr Oct 2, 2025
f6a4c52
Add events from main
eandreeva-twr Oct 2, 2025
e65e67f
Small fix
eandreeva-twr Oct 2, 2025
bc93ad9
fix: update rn snippets
StanislavMayorov Oct 3, 2025
5e1135d
Merge branch 'ADP-4241' into ADP-4313
eandreeva-twr Oct 8, 2025
f0fdd7e
Merge branch 'refs/heads/main' into ADP-4313
eandreeva-twr Nov 7, 2025
8355925
Feat/expo config rn v3.14
StanislavMayorov Nov 7, 2025
00f15c5
Add appAccountToken, obfuscatedAccountId, iosPresentationStyle, and p…
eandreeva-twr Nov 12, 2025
6b24479
Merge branch 'main' into ADP-4313
eandreeva-twr Nov 25, 2025
aa069ca
Remove duplicate line
eandreeva-twr Nov 25, 2025
ae5fac6
Get rid of the merge error
eandreeva-twr Nov 26, 2025
772b75e
Merge + add local access levels for Android
eandreeva-twr Nov 26, 2025
be59439
fix build
StanislavMayorov Dec 1, 2025
44c2b5d
Merge branch 'main' into ADP-4313
eandreeva-twr Dec 1, 2025
f8b9dc3
Notes about the import format
eandreeva-twr Dec 1, 2025
153b6cb
- 3.12 -> 3.14
eandreeva-twr Dec 1, 2025
220a552
feat: update setEventHandlers implementation
StanislavMayorov Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion versioned_docs/version-3.0/local-access-levels.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadataTitle: "Local access levels | Adapty Docs"
:::important
Note the following:
- Local access levels are supported in the Adapty SDK starting from version 3.12.
- By default, local access levels are disabled on Android. If you need them, [enable them during the SDK activation](sdk-installation-android#enable-local-access-levels).
- By default, local access levels are disabled on Android. If you need them, enable them during the SDK activation: [Android](sdk-installation-android#enable-local-access-levels), [React Native](sdk-installation-reactnative#enable-local-access-levels-android).
:::

Each product you configure has an [**access level**](access-level.md) linked to it. When your users make a purchase, the Adapty SDK assigns the access level to the user [profile](profiles-crm.md), so you need to use this access level to determine whether users can access paid content in the app.
Expand Down
129 changes: 129 additions & 0 deletions versioned_docs/version-3.0/migration-react-native-314.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
title: "Migrate Adapty React Native SDK to v. 3.14"
description: "Migrate to Adapty React Native SDK v3.14 for better performance and new monetization features."
metadataTitle: "Migrating to Adapty React Native SDK v3.14 | Adapty Docs"
---

import Zoom from 'react-medium-image-zoom';
import 'react-medium-image-zoom/dist/styles.css';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Adapty React Native SDK 3.14.0 is a major release that introduces improvements that require migration steps on your end:

- The `registerEventHandlers` method has been replaced with the `setEventHandlers` method.
- In `AdaptyOnboardingView`, event handlers are now passed as individual props instead of an `eventHandlers` object
- A new, simplified import style has been introduced for UI components
- The `logShowOnboarding` method has been deleted
- The minimum React Native version has been updated to 0.73.0

## Replace `registerEventHandlers` with `setEventHandlers`

The `registerEventHandlers` method used for working with Adapty Paywall and Onboarding Builder has been replaced with the `setEventHandlers` method.
If you use the Adapty Paywall Builder and/or Adapty Onboarding Builder, find `registerEventHandlers` in your app code and replace it with `setEventHandlers`.

The change has been introduced to make the method behavior clearer: Handlers now work one-at-a-time because each returns `true`/`false`, and having multiple handlers for a single event made the resulting behavior unclear.

Note that when using React components like `AdaptyOnboardingView` or `AdaptyPaywallView`, you don't need to return `true`/`false` from event handlers since you control the component's visibility through your own state management. Return values are only needed for modal screen presentation where the SDK manages the view lifecycle.

:::important
Calling `setEventHandlers` multiple times will override the handlers you provide, replacing both default and previously set handlers for those specific events.
:::

```diff showLineNumbers
- const unsubscribe = view.registerEventHandlers({
- // your event handlers
- })

const unsubscribe = view.setEventHandlers({
// your event handlers
})
```

## Update import paths for UI components

Adapty SDK 3.14.0 introduces a simplified import style for UI components. Instead of importing from `react-native-adapty/dist/ui`, you can now import directly from `react-native-adapty`.

The new import style is more consistent with standard React Native practices and makes the import statements cleaner. If you are using UI components like `AdaptyPaywallView` or `AdaptyOnboardingView`, update your imports as shown below:

```diff showLineNumbers
- import { AdaptyPaywallView } from 'react-native-adapty/dist/ui';
+ import { AdaptyPaywallView } from 'react-native-adapty';

- import { AdaptyOnboardingView } from 'react-native-adapty/dist/ui';
+ import { AdaptyOnboardingView } from 'react-native-adapty';

- import { createPaywallView } from 'react-native-adapty/dist/ui';
+ import { createPaywallView } from 'react-native-adapty';

- import { createOnboardingView } from 'react-native-adapty/dist/ui';
+ import { createOnboardingView } from 'react-native-adapty';
```

:::note
For backward compatibility, the old import style (`react-native-adapty/dist/ui`) is still supported. However, we recommend using the new import style for consistency and clarity.
:::

## Update onboarding event handlers in the React component

Event handlers for onboardings have been moved outside the `eventHandlers` object in `AdaptyOnboardingView`. If you are displaying onboardings using `AdaptyOnboardingView`, update the event handling structure.

:::important
Note the way we recommend implementing event handlers. To avoid recreating objects on each render, use `useCallback` for functions that handle events.
:::

```diff showLineNumbers
import React, { useCallback } from 'react';
- import { AdaptyOnboardingView } from 'react-native-adapty/dist/ui';
+ import { AdaptyOnboardingView } from 'react-native-adapty';
+ import type { OnboardingEventHandlers } from 'react-native-adapty';
+
+ function MyOnboarding({ onboarding }) {
+ const onAnalytics = useCallback<OnboardingEventHandlers['onAnalytics']>((event, meta) => {}, []);
+ const onClose = useCallback<OnboardingEventHandlers['onClose']>((actionId, meta) => {}, []);
+ const onCustom = useCallback<OnboardingEventHandlers['onCustom']>((actionId, meta) => {}, []);
+ const onPaywall = useCallback<OnboardingEventHandlers['onPaywall']>((actionId, meta) => {}, []);
+ const onStateUpdated = useCallback<OnboardingEventHandlers['onStateUpdated']>((action, meta) => {}, []);
+ const onFinishedLoading = useCallback<OnboardingEventHandlers['onFinishedLoading']>((meta) => {}, []);
+ const onError = useCallback<OnboardingEventHandlers['onError']>((error) => {}, []);
+
return (
<AdaptyOnboardingView
onboarding={onboarding}
style={styles.container}
- eventHandlers={{
- onAnalytics(event, meta) { /* ... */ },
- onClose(actionId, meta) { /* ... */ },
- onCustom(actionId, meta) { /* ... */ },
- onPaywall(actionId, meta) { /* ... */ },
- onStateUpdated(action, meta) { /* ... */ },
- onFinishedLoading(meta) { /* ... */ },
- onError(error) { /* ... */ },
- }}
+ onAnalytics={onAnalytics}
+ onClose={onClose}
+ onCustom={onCustom}
+ onPaywall={onPaywall}
+ onStateUpdated={onStateUpdated}
+ onFinishedLoading={onFinishedLoading}
+ onError={onError}
/>
);
+ }
```

:::note
For backward compatibility, the `eventHandlers` prop is still supported but is deprecated. We recommend migrating to individual event handler props as shown above.
:::


## Delete `logShowOnboarding`

In Adapty SDK 3.14.0, we have deleted the `logShowOnboarding` method from the SDK.
If you have been using this method, it won't be available when you upgrade the SDK to version 3.14 or later.

Instead, you can [create onboardings in the Adapty no-code onboarding builder](onboardings.md). Analytics for these onboardings are tracked automatically, and you have a lot of customization options.

## Update React Native

Starting from Adapty SDK 3.14.0, the minimum supported version of React Native is 0.73.0. If you are using an earlier version, update React Native to version 0.73.0 or later, so your experience with the Adapty SDK is consistent and reliable.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ The result of the `createOnboardingView` method can only be used once. If you ne
:::

```typescript showLineNumbers
import {createOnboardingView} from 'react-native-adapty/dist/ui';
import {createOnboardingView} from 'react-native-adapty';
// for the Adapty SDK < 3.14 – import {createOnboardingView} from 'react-native-adapty/dist/ui';

if (onboarding.hasViewConfiguration) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ The result of the `createPaywallView` method can only be used once. If you need
:::

```typescript showLineNumbers
import {createPaywallView} from 'react-native-adapty/dist/ui';
import {createPaywallView} from 'react-native-adapty';
// for the Adapty SDK < 3.14 – import {createPaywallView} from 'react-native-adapty/dist/ui';

if (paywall.hasViewConfiguration) {
try {
Expand Down
Loading