Skip to content

6.0.0

Latest

Choose a tag to compare

@EPIKorial EPIKorial released this 20 Jul 15:21

Purchasely iOS SDK 6.0.0

6.0.0 is a major release with breaking changes. It modernizes SDK initialization and the paywall display surface, replaces the global action interceptor with a granular per-action API, adds Swift Package Manager support, and lands cross-platform parity and reliability fixes. Most read-only call sites keep compiling; anything that configures the SDK or drives paywall display will need updates.

πŸ‘‰ Before upgrading, read the full Migration Guide. Every breaking change below links to a numbered section there with before/after code.


Highlights

πŸ”§ Fluent initialization builder

Purchasely.start(withAPIKey:…) is replaced by a fluent Purchasely.apiKey(…)…start() chain with async/await and completion-handler variants. ⚠️ The default running mode changed from .full to .observer β€” add .runningMode(.full) explicitly if you validate transactions.

🎯 Per-action interceptor API

setPaywallActionsInterceptor (one global handler, ambiguous boolean) is replaced by per-action Purchasely.interceptAction(.login) { … } returning an explicit PLYInterceptResult (.success / .failed / .notHandled), with async/await support and richer PLYInterceptorInfo context.

🧱 Consolidated paywall display around PLYPresentationBuilder

A single fluent builder now owns presentation, display, and dismissal end-to-end. It replaces the fetchPresentation(…) family, the UIViewController- and SwiftUI-view-returning factories, and showController(…). Supports content id, color and header-button overrides, and lifecycle callbacks (onPresented, onCloseRequested, onDismissed).

πŸ“¦ Enriched dismiss outcome

PLYPresentationBuilder.onDismissed and the renamed setDefaultPresentationDismissHandler now deliver a PLYPresentationOutcome carrying purchaseResult, plan, presentation, a new PLYCloseReason (.button / .interactiveDismiss / .programmatic / .none), and a reserved error field.

πŸ“ Transition sizing (height / width / dismissible)

PLYTransition (formerly PLYDisplayMode) gains additive sizing for drawer/popin β€” fixed pixels or percentage, plus a dismissible flag that blocks ambient dismiss when false. PLYDimension is now public so you can build sized transitions in code.

🍎 Direct SwiftUI access

PLYPresentation.swiftUIView gives SwiftUI consumers a paywall View directly off the preloaded presentation, replacing the old controller.PresentationView indirection.


Breaking changes

Full details and before/after code in the Migration Guide.

Initialization & configuration

  • Β§1 β€” Purchasely.start(withAPIKey:…) removed β†’ use the Purchasely.apiKey(…) builder. Default running mode is now .observer (was .full).
  • Pre-start class funcs (setEnvironment, setThemeMode, etc.) deprecated (removed in v7).

Action interceptors

  • Β§2 β€” setPaywallActionsInterceptor() removed β†’ Purchasely.interceptAction().
  • Β§3 β€” PLYPresentationInfo removed β†’ PLYInterceptorInfo.
  • Β§4 β€” paywallActionsInterceptor parameter removed from start().
  • Β§5 β€” PLYPaywallActionsInterceptor typealias removed.

Presentation & display

  • Β§6 β€” PLYPresentation is now a protocol (was a class); reads/methods compile unchanged.
  • Β§7 β€” PLYPresentationViewController.PresentationView removed.
  • Β§8/Β§9 β€” public delegate signatures and PLYInterceptorInfo.presentation take any PLYPresentation.
  • Β§10 β€” Purchasely.fetchPresentation(…) removed β†’ PLYPresentationBuilder.
  • Β§11 β€” closeDisplayedPresentation() removed β†’ closeAllScreens().
  • Β§12 β€” UIViewController-returning factories removed β†’ PLYPresentationBuilder.
  • Β§13 β€” Purchasely.display(…) simplified to a one-liner (transition: param; vendor-ID/completion/async overloads removed).
  • Β§14 β€” setDefaultPresentationResultHandler renamed to setDefaultPresentationDismissHandler, now delivers PLYPresentationOutcome.
  • Β§15 β€” SwiftUI embedded-view factories removed β†’ PLYPresentationBuilder + presentation.swiftUIView.
  • Β§21 β€” showController(_:type:from:) and PLYUIControllerType removed.
  • Β§22 β€” legacy "My Subscriptions" screen removed, along with PLYEvent.subscriptionsListViewed and .cancellationReasonPublished.

Renames (no compat aliases)

  • Β§17 β€” PLYDisplayMode β†’ PLYTransition, PLYDisplayModeType β†’ PLYTransitionType, PLYPresentation.id β†’ .screenId, PLYPresentation.displayMode β†’ .transition, PLYPresentationBuilder.onClose β†’ .onCloseRequested, clientPresentationOpened(with:) β†’ clientPresentationDisplayed(with:).

Deeplinks & attributes

  • Β§16 β€” ply/products/* and ply/plans/* deeplinks removed β†’ use ply/presentations/<id> or ply/placements/<id>.
  • Β§18 β€” readyToOpenDeeplink(_:) β†’ allowDeeplink(_:); isDeeplinkHandled(deeplink:) β†’ handleDeeplink(_:).
  • Β§19 β€” allowCampaigns now defaults to true (was false) and waits for configuration before displaying.
  • Β§20 β€” PLYAttribute.oneSignalPlayerId removed β†’ oneSignalExternalId / oneSignalUserId. Backend targeting rules keyed on onesignal_player_id must be repointed to onesignal_external_id.

Internal improvements (no code changes required)

  • AsyncStream action executor: Fixed an issue with double-completion actions from a single tap.
  • Unified display architecture: all presentations display through a single PLYWindow code path, fixing flow-state and missed-event edge cases.
  • Flow state corruption fix: no more orphaned SDK windows or corrupted flow state after certain dismiss sequences.
  • StoreKit: removed the FB22760273 commitment-price workaround (fixed by Apple); billing-plan-scoped offers for iOS 26.4 monthly commitment.
  • Numerous layout, header-button, tvOS focus, and iPad flow-close fixes.