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.
Take note that : On Android, we have adopted Google Billing v5.2.1 and the minimum required Kotlin version is 1.6.0 On iOS, setting a StoreKit version is mandatory
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?)
#import <Purchasely/Purchasely-Swift.h>
[Purchasely startWithAPIKey:@"API_KEY"
appUserId:@"USER_ID"
runningMode: PLYRunningModeFull
paywallActionsInterceptor:nil
storekitSettings: [StorekitSettings .storekit2] // optional but set to StoreKit 2 by default.
// Fallsback to StoreKit 1 in case the informations are not setup correctly on Purchasely console
logLevel: LogLevelInfo
initialized: nil];
// Paywall interceptor can be setted afterwards by calling
[Purchasely setPaywallActionsInterceptor:^(enum PLYPresentationAction, PLYPresentationActionParameters * _Nullable, PLYPresentationInfo * _Nullable, void (^ _Nonnull)(BOOL)) {
}];
// Set your ui listener
[Purchasely setUIDelegate:(id<PLYUIDelegate> _Nullable)Update for deeplinks
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
Purchase methodBy 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?