Migrar el SDK de Android de Adapty a la versión 3.0

Adapty SDK v3.0 introduces significant changes. This document outlines the key modifications to help you upgrade from v2.x to v3.0. We’ve made every effort to ensure backward compatibility, but some changes may require updates to your codebase.

Renaming Paywalls to Placements

In v3.0, we’ve renamed “paywalls” to “placements” throughout the SDK. This change reflects the concept that a “placement” is a specific location in your app where a paywall can be displayed. Here’s a summary of the renaming:

Before (v2.x)After (v3.0)
getPaywalls()getPlacements()
PaywallPlacement
paywallIdplacementId
paywallVariationIdplacementVariationId

Changes to AdaptyPaywall

AdaptyPaywall in v3.0 contains the following properties:

PropertyTypeDescription
placementIdStringThe ID of the placement in Adapty
variationIdStringThe ID of the variation in the A/B test
revisionIntThe revision of the paywall
onboardingScreensList<AdaptyOnboardingScreenContent>The onboarding screens for the paywall
remoteConfigAdaptyRemoteConfig?The remote config for the paywall
productsList<AdaptyPaywallProduct>The products associated with the paywall

Start Using Adapty Android SDK v3.0

Starting with v3.0, we recommend initializing the Adapty Android SDK in the Application.onCreate() method. This ensures the SDK is ready to use when your app launches.

To migrate to Adapty Android SDK v3.0:

  1. Install Adapty Android SDK v3.x.
  2. Make the changes listed in the sections below.

Changes to Adapty configuration

Configuration builder changes

The configuration builder was updated to allow for a more flexible setup. The new builder accepts an appKey parameter, which is your Adapty API key. The old builder accepted a apiKey parameter.

Changes to paywalls

Retrieving paywalls

The fetchPolicy parameter has been removed from getPaywall. This parameter previously controlled whether the SDK fetched fresh data from the server or used a cached version. You can now control this via the configuration builder.

Retrieving paywall products

Logging paywall display

Changes to AdaptyProfile

In v3.0, we’ve updated AdaptyProfile. The customAttributes property is now included in the AdaptyProfile.CustomerUser object rather than directly in the profile.

Changes to AdaptyPaywallProduct

In v3.0, we’ve updated AdaptyPaywallProduct. The variationId property has been removed and the paywallVariationId property has been renamed to variationId.

Changes to AdaptySubscriptionUpdateParameters

In v3.0, we’ve updated AdaptySubscriptionUpdateParameters. The replacementMode property has been renamed to prorationMode.

Changes to AdaptyPurchasedInfo

In v3.0, we’ve updated AdaptyPurchasedInfo. The response now includes the profile and, optionally, the purchase property.

Adapty SDK v3.0 trae soporte para el nuevo e innovador Adapty Paywall Builder, la nueva versión de la herramienta no-code y fácil de usar para crear paywalls. Con su máxima flexibilidad y ricas capacidades de diseño, tus paywalls serán más efectivos y rentables.

Los SDKs de Adapty se distribuyen como un BoM (Bill of Materials), lo que garantiza que las versiones del SDK de Adapty y del SDK de AdaptyUI en tu app sean siempre consistentes.

Para migrar a v3.0, actualiza tu código de la siguiente manera: