Skip to content

v3.0.1

Compare
Choose a tag to compare
@ren6 ren6 released this 23 Feb 12:03
· 71 commits to master since this release

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 🙂