Releases: apphud/ApphudSDK
Releases · apphud/ApphudSDK
3.0.0
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 StoreProduct
/SKProduct
models. - Added asynchronous
paywall(_ identifier: String) async -> ApphudPaywall?
method which returns specific paywall by identifier. - Added asynchronous
func fetchSKProducts() async -> [SKProduct]
method which returnsSKProducts
for identifiers added in Apphud Product Hub. - Added asynchronous
func purchase(_ product: ApphudProduct, isPurchasing: Binding<Bool>? = nil) async -> ApphudPurchaseResult
method which returns classicApphudPurchaseResult
. - Added new asynchronous
func restorePurchases() async -> Error?
method.
StoreKit 2
- Added asynchronous
fetchProducts() async throws -> [Product]
method which returnsProduct
structs for identifiers added in Apphud Product Hub. Throwable. - Added asynchronous
func purchase(_ product: Product, isPurchasing: Binding<Bool>? = nil) async -> ApphudAsyncPurchaseResult
method which returns newApphudAsyncPurchaseResult
struct. - Added
func apphudProductFor(_ product: Product) -> ApphudProduct?
method which returns correspondingApphudProduct
that matchesProduct
struct. - Added asynchronous
func product() async throws -> Product?
method toApphudProduct
object. Now you can retrieve bothSKProduct
andProduct
models from withinApphudProduct
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
toApphudPurchaseResult
. - 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. UseappleAdsAttribution
instead.- Removed
getPaywalls(callback: @escaping ([ApphudPaywall]?, Error?) -> Void)
method in favor ofpaywallsDidLoadCallback(_ callback: @escaping ([ApphudPaywall]) -> Void)
andpaywalls() async -> [ApphudPaywall]
methods. - Renamed
productsDidFetchCallback
tofetchProducts
and improved inner logic. - Removed
refreshStoreKitProducts
method in favor of improvedfetchProducts
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 newProduct
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 newProduct
struct. - dismiss paywall after successful purchase.
Like Apphud SDK? Feel free to put a star on Github 🙂
2.8.8
2.8.6
What’s new in 2.8.6:
- Added
func userDidLoad(rawPaywalls: [ApphudPaywall])
inApphudDelegate
. This method called when user is registered in Apphud - Added
func paywallsDidFullyLoad(paywalls: [ApphudPaywall])
inApphudDelegate
. This method called when paywalls are fully loaded with theirSKProducts
.
2.8.5
2.8.2
2.8.1
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.
2.7.0
What’s new in 2.7.0:
- WatchOS/tvOS support
- Added new
willPurchaseProductFromPaywall
method, which allows to use A/B experiments in Observer Mode - Internal cache improvements and bug fixes
- Now you can delete or update promotionals using the same SDK method
grantPromotional
or via web interface. Pass 0 daysCount to delete active promotional.
2.6.1
2.6.0
2.5.7
What’s new in 2.5.7:
- Fixed 403 server error bug, when user could be blocked from sever 403 error code
- Change
func paywallShown(_ paywall: ApphudPaywall)
andfunc paywallClosed(_ paywall: ApphudPaywall)
to non optionalpaywall
parameter - Add push token cache
- Update general cache time
- Update some Logs