v4.1.0
💥 Breaking changes
Adapty Attribution is now opt-in
Installation details are no longer collected unless you ask for them at activation. Until you do, onInstallationDetailsSuccess / onInstallationDetailsFail will not fire.
await adapty.activate('PUBLIC_SDK_KEY', {
adaptyAttributionEnabled: true,
});External attribution APIs are renamed
updateAttribution is now updateExternalAttribution, AdaptyProfile.appliedAttributionSources is now appliedExternalAttributionProviders.
import { adapty, type AdaptyExternalAttributionProvider } from 'react-native-adapty';
// before
await adapty.updateAttribution(attribution, 'adjust');
// after
await adapty.updateExternalAttribution(attribution, 'adjust');✨ New Features
Promoted purchases from the App Store
When a purchase is started from your product page in the App Store, the SDK now delivers the promoted product to JS through the new onPromotedPurchaseReceived event, and makePromotedPurchase completes it.
By default the SDK completes such a purchase itself, so nothing is lost if your app registers no listener. Registering a listener replaces that default — while it is registered, completing the purchase is up to you:
import { adapty } from 'react-native-adapty';
const subscription = adapty.addEventListener(
'onPromotedPurchaseReceived',
async product => {
console.log(product.vendorProductId, product.localizedTitle);
// you are now responsible for completing it
await adapty.makePromotedPurchase(product);
},
);Promoted purchases are an App Store feature, so the event fires on iOS only.
Swift Package Manager integration (React Native 0.87+)
The SDK now ships a Package.swift manifest, so it can be installed through React Native's experimental SwiftPM support (npx react-native spm) instead of CocoaPods (SPM). Kids Mode is supported on that path through a new adapty-spm-kids-mode binary, wired from your app's postinstall.
Custom layouts for flows
A flow view can now be rendered with an explicit layout instead of the one resolved automatically for the current device:
import { AdaptyFlowView } from 'react-native-adapty';
<AdaptyFlowView flow={flow} params={{ customLayoutId: 'tablet_layout' }} />;🐛 Fixes
-
AdaptyFlow.hasViewConfigurationis back.AdaptyPaywallcarried this flag in 3.x, but it was dropped in v4.0.0 whenAdaptyPaywallwas replaced byAdaptyFlow. Use it to tell whether a flow has a UI Builder layout to present:import { adapty, createFlowView } from 'react-native-adapty'; const flow = await adapty.getFlow('onboarding'); if (flow.hasViewConfiguration) { const view = await createFlowView(flow); await view.present(); } else { // No UI Builder layout for this flow — render your own screen // from flow.remoteConfigs / flow.paywalls instead. showCustomScreen(flow); }
-
(android) Fixed a Gradle configuration failure on AGP 9:
Cannot add extension with name 'kotlin'. It only happened withandroid.builtInKotlin=true, where AGP registers the Kotlin extension itself. Thanks to @gabrieldonadel for the fix. -
(android) Flow builder UI fixes.
-
(iOS) Flow analytics parameters valued
0or1arrived as booleans. The first screen of a flow reportedscreen_order: trueinstead ofscreen_order: 1. Analytics sent to Adapty were always correct — only the payload handed to your flowonAnalyticshandler was affected.