ApphudSDK Versions Save

Build, Measure and Grow iOS subscription business

3.2.0

5 months ago

What's New in Apphud SDK 3.2.0

  • Placements: Offers a strategic method to integrate paywalls throughout your app. This feature allows developers to position paywalls effectively in different app sections, such as onboarding or settings, targeting distinct user audiences. For more comprehensive information, please refer to our Placements guide.
  • [Breaking] The Apphud.start(..) method now returns an ApphudUser object in the callback instead of void.
  • [Breaking] Removed the variationName property from the ApphudPaywall object to avoid misleading usage.
  • New Method: Added func placements() async -> [ApphudPlacement] to retrieve an array of ApphudPlacement objects, including their inner StoreKit products.
  • New Method: Added placement(_ identifier: String) async -> ApphudPlacement? to retrieve a specific placement by identifier.
  • New Alternative Method: Added func placementsDidLoadCallback(_ callback: @escaping ([ApphudPlacement]) -> Void) to retrieve placements with their inner StoreKit products in a callback.
  • New Method: Added func rawPlacements() -> [ApphudPlacement] to retrieve placements immediately, without waiting for StoreKit products to load.
  • New Method: Added func rawPaywalls() -> [ApphudPaywall] to retrieve paywalls immediately, without waiting for StoreKit products to load.
  • [Breaking] Renamed func willPurchaseProductFromPaywall(_ identifier: String) to func willPurchaseProductFrom(paywallIdentifier: String, placementIdentifier: String?).
  • [Breaking] Changed static var permissionGroups: [ApphudGroup] to func permissionGroups() async -> [ApphudGroup]?.
  • [Breaking] Removed the method func purchaseWithoutValidation(_ productId: String, callback: ((ApphudPurchaseResult) -> Void)?).
  • [Breaking] Removed the method func validateReceipt(callback: @escaping ([ApphudSubscription]?, [ApphudNonRenewingPurchase]?, Error?) -> Void).
  • Main Thread Requirement: Methods that require the main thread have been marked with the @MainActor attribute.
  • Refactors: Internal refactoring to utilize more Swift Concurrency code and Actors.

ApphudDelegate

  • New Delegate Method: Added func placementsDidFullyLoad(placements: [ApphudPlacement]) to get notified when placements are loaded with their inner StoreKit products.
  • [Breaking] Removed the ApphudDelegate method func apphudProductIdentifiers().
  • [Breaking] Removed the ApphudDelegate method func apphudDidFetchStoreKitProducts(_ products: [SKProduct], _ error: Error?).
  • [Breaking] Removed the ApphudDelegate method func apphudDidFetchStoreKitProducts(_ products: [SKProduct]).
  • [Breaking] Renamed the ApphudDelegate method func userDidLoad(rawPaywalls: [ApphudPaywall]) to func userDidLoad(user: ApphudUser).

3.1.3

6 months ago
  • Replaced thread-safe collection with actor for iOS 15+
  • Fixed a bug when deferred purchase delegate callback was not called in all cases

3.1.0

7 months ago

What's new in Apphud SDK 3.1.0:

  • Added paywalls fallback mode. Just add a Paywalls JSON file to the resources folder, which will be used as a fallback in rare case of Apphud unavailability. JSON file can be downloaded from Apphud Products Hub.
  • Refactored all models to conform to Codable protocol
  • Fixed deprectated method warnings
  • Fixed a potential bug that could lead to a crash when modifying arrays across different threads (thread-safe collections)
  • Fixed a bug when paywallsDidLoadCallback not called if failed to retrieve products from the App Store
  • Fixed a bug when screens was not showing up immediately if Apphud SDK responded faster than application became active
  • Fixed a warning from Xcode when refreshing receipt
  • Objective-C apps are now supported only in Observer mode. Consider writing your own bridge class to call Apphud SDK's Swift methods, if necessary.

3.0.1

1 year ago

We have worked hard on a new major iOS SDK update and happy to announce that it is now available.

What's new in iOS SDK 3.0.1:

  • Improved reinstall tracking

What's new in iOS SDK 3.0.0:

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 previous SDK version.

Swift Concurrency

We added 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 asynchronous func paywalls() async -> [ApphudPaywall] method which returns paywalls with their App Store Product / SKProduct models.
  • Added asynchronous paywall(_ identifier: String) async -> ApphudPaywall? method which returns specific paywall by identifier.
  • Added asynchronous func fetchSKProducts() async -> [SKProduct] method which returns SKProducts for identifiers added in Apphud Product Hub.
  • Added asynchronous func purchase(_ product: ApphudProduct, isPurchasing: Binding<Bool>? = nil) async -> ApphudPurchaseResult method which returns classic ApphudPurchaseResult.
  • Added new asynchronous func restorePurchases() async -> Error? method.

StoreKit 2

  • Added asynchronous fetchProducts() async throws -> [Product] method which returns Product structs for identifiers added in Apphud Product Hub. Throwable.
  • Added asynchronous func purchase(_ product: Product, isPurchasing: Binding<Bool>? = nil) async -> ApphudAsyncPurchaseResult method which returns new ApphudAsyncPurchaseResult struct.
  • Added func apphudProductFor(_ product: Product) -> ApphudProduct? method which returns corresponding ApphudProduct that matches Product struct.
  • Added asynchronous func product() async throws -> Product? method to ApphudProduct object. Now you can retrieve both SKProduct and Product models from within ApphudProduct object.

SwiftUI

  • Added optional $isPurchasing Binding to a boolean value that determines whether the payment is currently in process.
  • New Apphud SwiftUI Demo App.

General Changes

  • Added new var success: Bool to ApphudPurchaseResult.
  • Added new func didUpdateNotification() -> Notification.Name notification method which is posted whenever any purchase or subscription changes. Useful in Swift and SwiftUI.
  • appleSearchAds enum value made unavailable due to iAd framework is no longer supported by Apple. Use appleAdsAttribution instead.
  • Removed getPaywalls(callback: @escaping ([ApphudPaywall]?, Error?) -> Void) method in favor of paywallsDidLoadCallback(_ callback: @escaping ([ApphudPaywall]) -> Void) and paywalls() async -> [ApphudPaywall] methods.
  • Renamed productsDidFetchCallback to fetchProducts and improved inner logic.
  • Removed refreshStoreKitProducts method in favor of improved fetchProducts method.
  • Deprecated migratePurchasesIfNeeded {} method for iOS 15+ devices.
  • Fixed a bug when the very first in-app purchase was tracked with zero price if product id was not beforehand added in Product Hub.
  • Added optional callback to start(apiKey: String, ..., callback: (() -> Void)? = nil) method. Useful for retrieving A/B experiment data as soon as possible.
  • Added optional callback to 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 new func optOutOfTracking() method which opts out a user from tracking of some parameters, like IP address, IDFA, IDFV, Device Type.
  • Added initialization delay when app is inactive and isProtectedDataAvailable is false. Useful for app prewarming in iOS 15+ when 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 event for integrations, like Appsflyer or Facebook.

  • Added new purchase(_ product: ApphudProduct, value: Double, callback: ((ApphudPurchaseResult) -> Void)?) method.
  • Added 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 Binding<Bool> variable
  • update view according to subscription or puchase changes using Apphud.didUpdateNotification().
  • fetch paywalls and display multiple Apphud products on a view using VStack.
  • control purchase button text and availability.
  • use universal helper method to display pricing terms for any product with or without introductry offer.
  • make a purchase with both options: with SKProduct model or new Product struct.
  • update UI while purchase is in a process using $isPurchasing Binding.
  • dismiss paywall after successful purchase.

Redesigned Apphud Swift Demo App

What’s inside? In Swift Demo App you will learn how to:

  • update view according to subscription or puchase changes using Apphud.didUpdateNotification().
  • fetch paywalls and display multiple Apphud products on a view using UIStackView.
  • use universal helper method to display pricing terms for any product with or without introductry offer.
  • make a purchase with both options: with SKProduct model or new Product struct.
  • dismiss paywall after successful purchase.

Like Apphud SDK? Feel free to put a star on Github 🙂

3.0.0

1 year ago

We have worked hard on a new major iOS SDK update and happy to announce that it is now available.

What's new in iOS SDK 3.0.0:

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 previous SDK version.

Swift Concurrency

We added 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 asynchronous func paywalls() async -> [ApphudPaywall] method which returns paywalls with their App Store Product / SKProduct models.
  • Added asynchronous paywall(_ identifier: String) async -> ApphudPaywall? method which returns specific paywall by identifier.
  • Added asynchronous func fetchSKProducts() async -> [SKProduct] method which returns SKProducts for identifiers added in Apphud Product Hub.
  • Added asynchronous func purchase(_ product: ApphudProduct, isPurchasing: Binding<Bool>? = nil) async -> ApphudPurchaseResult method which returns classic ApphudPurchaseResult.
  • Added new asynchronous func restorePurchases() async -> Error? method.

StoreKit 2

  • Added asynchronous fetchProducts() async throws -> [Product] method which returns Product structs for identifiers added in Apphud Product Hub. Throwable.
  • Added asynchronous func purchase(_ product: Product, isPurchasing: Binding<Bool>? = nil) async -> ApphudAsyncPurchaseResult method which returns new ApphudAsyncPurchaseResult struct.
  • Added func apphudProductFor(_ product: Product) -> ApphudProduct? method which returns corresponding ApphudProduct that matches Product struct.
  • Added asynchronous func product() async throws -> Product? method to ApphudProduct object. Now you can retrieve both SKProduct and Product models from within ApphudProduct object.

SwiftUI

  • Added optional $isPurchasing Binding to a boolean value that determines whether the payment is currently in process.
  • New Apphud SwiftUI Demo App.

General Changes

  • Added new var success: Bool to ApphudPurchaseResult.
  • Added new func didUpdateNotification() -> Notification.Name notification method which is posted whenever any purchase or subscription changes. Useful in Swift and SwiftUI.
  • appleSearchAds enum value made unavailable due to iAd framework is no longer supported by Apple. Use appleAdsAttribution instead.
  • Removed getPaywalls(callback: @escaping ([ApphudPaywall]?, Error?) -> Void) method in favor of paywallsDidLoadCallback(_ callback: @escaping ([ApphudPaywall]) -> Void) and paywalls() async -> [ApphudPaywall] methods.
  • Renamed productsDidFetchCallback to fetchProducts and improved inner logic.
  • Removed refreshStoreKitProducts method in favor of improved fetchProducts method.
  • Deprecated migratePurchasesIfNeeded {} method for iOS 15+ devices.
  • Fixed a bug when the very first in-app purchase was tracked with zero price if product id was not beforehand added in Product Hub.
  • Added optional callback to start(apiKey: String, ..., callback: (() -> Void)? = nil) method. Useful for retrieving A/B experiment data as soon as possible.
  • Added optional callback to 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 new func optOutOfTracking() method which opts out a user from tracking of some parameters, like IP address, IDFA, IDFV, Device Type.
  • Added initialization delay when app is inactive and isProtectedDataAvailable is false. Useful for app prewarming in iOS 15+ when 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 event for integrations, like Appsflyer or Facebook.

  • Added new purchase(_ product: ApphudProduct, value: Double, callback: ((ApphudPurchaseResult) -> Void)?) method.
  • Added 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 Binding<Bool> variable
  • update view according to subscription or puchase changes using Apphud.didUpdateNotification().
  • fetch paywalls and display multiple Apphud products on a view using VStack.
  • control purchase button text and availability.
  • use universal helper method to display pricing terms for any product with or without introductry offer.
  • make a purchase with both options: with SKProduct model or new Product struct.
  • update UI while purchase is in a process using $isPurchasing Binding.
  • dismiss paywall after successful purchase.

Redesigned Apphud Swift Demo App

What’s inside? In Swift Demo App you will learn how to:

  • update view according to subscription or puchase changes using Apphud.didUpdateNotification().
  • fetch paywalls and display multiple Apphud products on a view using UIStackView.
  • use universal helper method to display pricing terms for any product with or without introductry offer.
  • make a purchase with both options: with SKProduct model or new Product struct.
  • dismiss paywall after successful purchase.

Like Apphud SDK? Feel free to put a star on Github 🙂

2.8.8

1 year ago

Bug fix for Flutter SDK

2.8.6

1 year ago

What’s new in 2.8.6:

  • Added func userDidLoad(rawPaywalls: [ApphudPaywall]) in ApphudDelegate. This method called when user is registered in Apphud
  • Added func paywallsDidFullyLoad(paywalls: [ApphudPaywall]) in ApphudDelegate. This method called when paywalls are fully loaded with their SKProducts.

2.8.5

1 year ago

What’s new in 2.8.5:

  • hasActiveSubscription(), hasPremiumAccess() improvements and bug fixes
  • Methods descriptions improvements
  • Added purchasePromo() logging
  • Added checkTransactions logic for force receipt sending if a new transaction was found.

2.8.2

1 year ago

What's new in 2.8.2:

  • Improved interaction with Apple Search Ads attribution.
  • Updated methods description and improve documentation.

2.8.1

2 years ago

What's new in 2.8.1:

  • Added new method willPurchaseProductFromPaywall(_ identifier: String) which allows you to specify paywall id in observer mode. This will allow you to use our A/B experiments in Observer Mode.
  • Deprecated facebook integration from SDK because it is now redundant.
  • Significant improvements and lots of refactoring related to request handling, logging and purchase tracking.