Repository navigation
v4.4.0
π₯ Breaking changes
π Read more in Migrate to v4.4.
- New fallback file format. Download both fallback files again for SDK 4.4.0 and higher: with a file for 4.1β4.3,
adapty.setFallbackthrows anAdaptyError. - (iOS) Flows require iOS 16. On iOS 15,
createFlowViewthrows anAdaptyErrorwith theplatformNotSupportedcode (4001), andAdaptyFlowViewstays empty and reports the same error toonError. The rest of the SDK, such as purchases and custom paywalls, still supports iOS 15. - (iOS) Flow and onboarding calls made while AdaptyUI isn't activated throw
adaptyUINotActivated(4003) oradaptyNotActivated(4002) instead ofunknown. - TypeScript:
AdaptyPrice.currencyCode,AdaptyPrice.localizedStringandbillingPlanof a profile subscription are required β only code that builds these objects itself, such as test fixtures orAdaptyMockConfig, has to fill them.
β¨ New Features
Custom elements in flows
Show your own native views inside a flow: a Lottie animation, a chart, a map β in every custom element you add in the Flow & Paywall Builder. Write the views and a resolver that matches each custom element's Type and ID to a view in Swift for iOS and in Kotlin for Android, and set the resolver once at app launch. The SDK uses it in every flow, both presented with createFlowView and with react component AdaptyFlowView.
π Read more in Display custom elements.
- React Native components in custom elements will be added in a later release. For now, custom elements show native views only.
Send messages to a flow
sendAppMessage(payload) sends a JSON object to the running flow, from a modal view or through the AdaptyFlowView ref. Support for app messages in the Flow & Paywall Builder in the dashboard will be added later; until then flows ignore these messages, so you don't need to call it.
Custom action arguments
onCustomAction receives a second parameter, args. It's reserved for future Flow & Paywall Builder capabilities and is an empty object for now.
π Improvements
AdaptyFlowViewreports toonErrorwhen it can't show its flow, with the errorcreateFlowViewwould throw for the same flow β for example, the flow fails to load while AdaptyUI isn't activated, or for acustomLayoutIdthe flow doesn't have; on iOS 15 withplatformNotSupported. Before, the component stayed empty. The error is reported once for each rendered view, and the return value ofonErroris ignored: stop rendering the component and show your own content.- TypeScript: AdaptyUI error codes. Codes 4001β4005, 4103, 4108, 4200 and 4300 now have names in
ErrorCodeandErrorCodeName(platformNotSupported,adaptyUINotActivated,webKitand others). - Changing
floworparamsof a mountedAdaptyFlowViewrecreates the native view with the new configuration. Events of the previous configuration no longer reach the handlers. - (iOS) Flows. Alert dialogs show localized strings.
π Fixes
AdaptyFlowViewcould miss events sent right after it mounted, such as an early error.- (android) Flows. An exception thrown by the flow script while handling an SDK event was only logged. It now reaches
onErrorasjsException, like other script errors. The defaultonErrorhandler closes a flow fromcreateFlowViewon it: returnfalseto keep the flow open. - (android) Observer mode.
reportTransactioncould fail to link the transaction to the providedvariationId. Pass thevariationIdof the purchased product's paywall, not of the flow. - (android) Observer mode.
reportTransactionfailed withnoPurchasesToRestorewhen there was nothing to restore. It now resolves with the current profile. - (android) Flows. An
AdaptyFlowViewdetached and attached again stayed blank. - (android) Flows. An unmounted
AdaptyFlowViewkept its flow in memory until the activity was destroyed. - (android) Flows. Various rendering fixes.
- (iOS) Flows. A screen shown inside another screen could be laid out at the full device size (since 4.3.2).
- (iOS) Flows. In a flow whose layout direction differs from the app's, side safe-area insets landed on the wrong side.
- (iOS) Flows. Text could be truncated in rotated or scaled elements.
- (iOS) Flows. Layout and animation fixes.