What’s new: iOS SDK Update
In Apphud, we have worked hard on a new major iOS SDK update and are happy to announce that it is now available. Let's take a look at what's new in iOS SDK 3.0.

Apphud SDK Availability
Changed minimum deployment target to 13.0. If your app targets iOS 12 devices or lower, you should either upgrade to minimum 13.0 or use the previous SDK version.
Swift Concurrency
We added the ability to purchase products using async/await syntax and modern Product struct as well as some other helpful methods. SDK gently operates with both StoreKit and StoreKit2 frameworks simultaneously.
- Added the asynchronous
func paywalls() async -> [ApphudPaywall]method which returns paywalls with their App StoreProduct / SKProductmodels. - Added the asynchronous
paywall(_ identifier: String) async -> ApphudPaywall?method which returns a specific paywall by identifier. - Added the asynchronous
func fetchSKProducts() async -> [SKProduct]method which returnsSKProductsfor identifiers added in Apphud Product Hub. - Added the asynchronous
func purchase(_ product: ApphudProduct, isPurchasing: Binding<Bool>? = nil) async -> ApphudPurchaseResultmethod which returns classicApphudPurchaseResult. - Added the new asynchronous
func restorePurchases() async -> Error?method.
StoreKit 2
- Added the asynchronous
fetchProducts() async throws -> [Product]method which returns Product structs for identifiers added in Apphud Product Hub. Throwable. - Added the asynchronous
func purchase(_ product: Product, isPurchasing: Binding<Bool>? = nil) async -> ApphudAsyncPurchaseResultmethod which returns a newApphudAsyncPurchaseResultstruct. - Added the
func apphudProductFor(_ product: Product) -> ApphudProduct?method which returns the correspondingApphudProductthat matches theProductstruct. - Added the asynchronous
func product() async throws -> Product?method to theApphudProductobject. Now you can retrieve bothSKProductandProductmodels from withinApphudProductobject.
SwiftUI
- Added optional
$isPurchasingBinding to a boolean value that determines whether the payment is currently in process. - New Apphud SwiftUI Demo App.
General Changes
- Added a new
var success: BooltoApphudPurchaseResult. - Added a new
func didUpdateNotification() -> Notification.Namenotification method which is posted whenever any purchase or subscription changes. Useful in Swift and SwiftUI. appleSearchAdsenum value made unavailable due to the iAd framework is no longer supported by Apple. UseappleAdsAttributioninstead.- Removed the
getPaywalls(callback: @escaping ([ApphudPaywall]?, Error?) -> Void)method in favor ofpaywallsDidLoadCallback(_ callback: @escaping ([ApphudPaywall]) -> Void)andpaywalls() async -> [ApphudPaywall]methods. - Renamed
productsDidFetchCallbacktofetchProductsand improved inner logic. - Removed the
refreshStoreKitProductsmethod in favor of the improvedfetchProductsmethod. - Deprecated the
migratePurchasesIfNeeded {}method for iOS 15+ devices. - Fixed a bug when the very first in-app purchase was tracked with zero price if the product id was not beforehand added in Product Hub.
- Added optional callback to the
start(apiKey: String, ..., callback: (() -> Void)? = nil)method. Useful for retrieving A/B experiment data as soon as possible. - Added optional callback to the
startManually(apiKey: String, ..., callback: (() -> Void)? = nil)method. Useful for retrieving A/B experiment data as soon as possible. - Multiple refactors and internal improvements.
- Redesigned Apphud Swift Demo App.
Privacy
- Added a new
func optOutOfTracking()method which opts out a user from tracking some parameters, like IP address, IDFA, IDFV, Device Type. - Added initialization delay when an app is inactive and
isProtectedDataAvailableis false. Useful for app prewarming in iOS 15+ when the screen is locked.
Custom Purchase Value
You can now set custom purchase value for successful free trial purchases. This value will be used for trial_started events for integrations, like Appsflyer or Facebook.
- Added a new
purchase(_ product: ApphudProduct, value: Double, callback: ((ApphudPurchaseResult) -> Void)?)method. - Added the
setCustomValueForTrial(_ value: Double, productId: String)method analog for Observer Mode.
Apphud SwiftUI Demo App
What’s inside? In SwiftUI Demo App you will learn how to:
- Present and dismiss a paywall using the
Binding<Bool>variable. - Update view according to subscription or app purchase changes using
Apphud.didUpdateNotification(). - Fetch paywalls and display multiple Apphud products on a view using
VStack. - Control purchase button text and availability.
- Use the universal helper method to display pricing terms for any product with or without the introductory offer.
- Make a purchase with both options:
SKProductmodel or newProductstruct. - Update UI while a purchase is in the process using
$isPurchasingBinding. - Dismiss the paywall after a successful app purchase.
Redesigned Apphud Swift Demo App
What’s inside? In Swift Demo App you will learn how to:
- Update view according to app subscription or purchase changes using
Apphud.didUpdateNotification(). - Fetch paywalls and display multiple Apphud products on a view using
UIStackView. - Use the universal helper method to display pricing terms for any product with or without the introductory offer.
- Make a purchase with both options:
SKProductmodel or newProductstruct. - Dismiss the paywall after a successful purchase.
Apphud is the in-app subscription infrastructure that helps you increase app revenue. Like Apphud SDK? Feel free to put a star on Github.
