Skip to content

v4.4.0

Latest

Choose a tag to compare

@StanislavMayorov StanislavMayorov released this 24 Nov 19:31
d40cacb

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.setFallback throws an AdaptyError.
  • (iOS) Flows require iOS 16. On iOS 15, createFlowView throws an AdaptyError with the platformNotSupported code (4001), and AdaptyFlowView stays empty and reports the same error to onError. 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) or adaptyNotActivated (4002) instead of unknown.
  • TypeScript: AdaptyPrice.currencyCode, AdaptyPrice.localizedString and billingPlan of a profile subscription are required β€” only code that builds these objects itself, such as test fixtures or AdaptyMockConfig, 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

  • AdaptyFlowView reports to onError when it can't show its flow, with the error createFlowView would throw for the same flow β€” for example, the flow fails to load while AdaptyUI isn't activated, or for a customLayoutId the flow doesn't have; on iOS 15 with platformNotSupported. Before, the component stayed empty. The error is reported once for each rendered view, and the return value of onError is 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 ErrorCode and ErrorCodeName (platformNotSupported, adaptyUINotActivated, webKit and others).
  • Changing flow or params of a mounted AdaptyFlowView recreates 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

  • AdaptyFlowView could 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 onError as jsException, like other script errors. The default onError handler closes a flow from createFlowView on it: return false to keep the flow open.
  • (android) Observer mode. reportTransaction could fail to link the transaction to the provided variationId. Pass the variationId of the purchased product's paywall, not of the flow.
  • (android) Observer mode. reportTransaction failed with noPurchasesToRestore when there was nothing to restore. It now resolves with the current profile.
  • (android) Flows. An AdaptyFlowView detached and attached again stayed blank.
  • (android) Flows. An unmounted AdaptyFlowView kept 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.

❗️ Don't forget to update your local fallback file