Migration guide to Android Adapty SDK 3.10.0
Adapty SDK 3.10.0 is a major release that brought some improvements that however may require some migration steps from you:
AdaptyUiPersonalizedOfferResolverhas been removed. If you are using it, pass it in theonAwaitingPurchaseParamscallback.- Update the
onAwaitingSubscriptionUpdateParamsmethod signature for Paywall Builder paywalls.
Update purchase parameters callback
The onAwaitingSubscriptionUpdateParams method has been renamed to onAwaitingPurchaseParams and now uses AdaptyPurchaseParameters instead of AdaptySubscriptionUpdateParameters. This allows you to specify subscription replacement parameters (crossgrade) and indicate whether the price is personalized (read more), along with other purchase parameters.
- override fun onAwaitingSubscriptionUpdateParams(
- product: AdaptyPaywallProduct,
- context: Context,
- onSubscriptionUpdateParamsReceived: SubscriptionUpdateParamsCallback,
- ) {
- onSubscriptionUpdateParamsReceived(AdaptySubscriptionUpdateParameters(...))
- }
+ override fun onAwaitingPurchaseParams(
+ product: AdaptyPaywallProduct,
+ context: Context,
+ onPurchaseParamsReceived: AdaptyUiEventListener.PurchaseParamsCallback,
+ ): AdaptyUiEventListener.PurchaseParamsCallback.IveBeenInvoked {
+ onPurchaseParamsReceived(
+ AdaptyPurchaseParameters.Builder()
+ .withSubscriptionUpdateParams(AdaptySubscriptionUpdateParameters(...))
+ .withOfferPersonalized(true)
+ .build()
+ )
+ return AdaptyUiEventListener.PurchaseParamsCallback.IveBeenInvoked
+ }
If no additional parameters are needed, you can simply use:
+ override fun onAwaitingPurchaseParams(
product: AdaptyPaywallProduct,
context: Context,
onPurchaseParamsReceived: AdaptyUiEventListener.PurchaseParamsCallback,
): AdaptyUiEventListener.PurchaseParamsCallback.IveBeenInvoked {
onPurchaseParamsReceived(AdaptyPurchaseParameters.Empty)
return AdaptyUiEventListener.PurchaseParamsCallback.IveBeenInvoked
}