Migrate to SDK v4.0.0

Introducing Promotional offers

At Purchasely, we believe that every app deserves to be profitable. That's why we're excited to announce the release of our new SDK version 4.0.0, which allows you to set promotional offers. This new version makes it easier than ever to create and manage effective promotional campaigns, helping you to increase your app's revenue.

Initialization update

The start method no longer includes the uiListener/uiDelegate and eventListener/eventDelegate configuration options as part of its initial configuration, but they can still be set after calling the start() method.

import Purchasely

Purchasely.start(withAPIKey: "API_KEY",
                         appUserId: "USER_ID",
                         runningMode: .full,
                         paywallActionsInterceptor: PLYPaywallActionsInterceptor,
                         storekitSettings: .storeKit2, // Set your StoreKit version
                         logLevel: .debug, // set to warning or error for release
                         initialized: PLYSuccessErrorClosure))
                         
// Paywall interceptor can be setted afterwards by calling
Purchasely.setPaywallActionsInterceptor { [weak self] (action, parameters, presentationInfo, proceed) in
}

// Set your ui listener
Purchasely.Purchasely.setUIDelegate(PLYUIDelegate?)

The attribute isReadyToPurchase , to indicate that your app is ready to open deeplinks, has been renamed to readyToOpenDeeplink

We have additionally changed the name of the method handle to isDeeplinkHandled

Methods for presentation display

Only with our bridges SDKs: ReactNative, Flutter and Unity Before you could call the method Purchasely.closePresentation() to hide the presentation or Purchasely.closePresentation(true) to close it We have changed those methods and added new ones to make it easier to manage and understand, see below

Fetch presentation with context (Android only)

The methods FetchPresentation and FetchPresentationForPresentation have been updated as well. The previously required parameters Context and PLYPresentationResultHandler have been removed and are no longer necessary.

Use Views instead of Fragments (Android only)

In this version, we have taken the step to entirely eliminate fragment-related methods that had been deprecated in our prior releases. Instead, opt for one of the view-related methods to display your presentations:

And to ensure coherence and consistency, we've gone ahead and renamed all classes, enums, and interfaces related to fragments.

Update Purchase method

By introducing offer to the purchase method as an optional parameter, we now support the ability to purchase a specific offer of a plan.

Last updated

Was this helpful?