Apphud v0.9.0 Release Notes
Release Date: 2020-03-09 // about 4 years ago-
What's new in Apphud SDK 0.9.0:
- 👌 Support for consumable, non-consumable and non-renewing subscription in-app purchases.
- ➕ Added new Apphud delegate method
func apphudNonRenewingPurchasesUpdated(_ purchases: [ApphudNonRenewingPurchase])
. Called when standard in-app purchase is made or has been refunded. - 👍 Apple Search Ads attribution support.
- ➕ Added new method
func productsDidFetchCallback(_ callback: @escaping ([SKProduct]) -> Void)
. Set up a callback block when SKProducts are loaded from the App Store. - ➕ Added new method
func refreshStoreKitProducts(_ callback: (([SKProduct]) -> Void)?)
to force refresh products. Should be used only as a fallback, because Apphud SDK automatically fetched products from the App Store at launch. - ➕ Added new class
ApphudPurchaseResult
, which containssubscription
,nonRenewingPurchase
,transaction
anderror
properties. - 🔄 Changed method
func purchase(_ product: SKProduct, callback: ((ApphudPurchaseResult) -> Void)?)
. Now it returns a new classApphudPurchaseResult
which contains all the necessary data. - ➕ Added new method
func purchaseWithoutValidation(_ product: SKProduct, callback: ((SKPaymentTransaction, Error?) -> Void)?)
. This method is just a wrapper method around StoreKit, and it doesn't wait until receipt is validated. It immediately returnsSKPaymentTransaction
object. Use this if you don't care about validating receipts. - Changed method
func purchasePromo(_ product: SKProduct, discountID: String, _ callback: ((ApphudPurchaseResult) -> Void)?)
. Now it returns a new classApphudPurchaseResult
which contains all the necessary data. - Method that was deprecated is now completely removed
func submitReceipt(_ productIdentifier : String, _ callback : ((ApphudSubscription?, Error?) -> Void)?)
. Apphud SDK automatically submits App Store receipts to Apphud. - ➕ Added new method
func nonRenewingPurchases() -> [ApphudNonRenewingPurchase]?
which returns array of standard in-app purchases, if there are any. - ➕ Added new class
ApphudNonRenewingPurchase
which contains product identifier, purchase date and and optional cancellation date. - ➕ Added new method
func isNonRenewingPurchaseActive(productIdentifier : String) -> Bool
. Returnstrue
if current user has purchased standard in-app purchase with given product identifier. Returnsfalse
if this product is refunded or never purchased. - ⏪ Method
restoreSubscriptions
renamed tofunc restorePurchases(callback: @escaping ([ApphudSubscription]?, [ApphudNonRenewingPurchase]?, Error?) -> Void)
. Added new callback parameter[ApphudNonRenewingPurchase]?
, which returns array of standard in-app purchases, if there are any. - Method
migrateSubscriptionsIfNeeded
renamed tofunc migratePurchasesIfNeeded(callback: @escaping ([ApphudSubscription]?, [ApphudNonRenewingPurchase]?, Error?) -> Void)
. Added new callback parameter[ApphudNonRenewingPurchase]?
, which returns array of standard in-app purchases, if there are any. - ➕ Added new method
func setFinishAllTransactions()
. Using this method Apphud SDK will finish all pending transactions, not only those that were started by Apphud SDK. SeeApphud.swift
for details. - Apphud SDK now tries to re-register user, re-fetch products and re-submit receipts when application becomes active if there were errors on app launch; for example, if there was no Internet connection.
Migration guide to 0.9.0:
- ⚡️ Update pod using terminal:
pod update ApphudSDK
- ⚡️ Update method from
Apphud.purchase(product) { (subsription, error) in ...}
toApphud.purchase(product) { result in ...}
. You will findsubscription
anderror
objects inside newApphudPurchaseResult
object. - ⚡️ Update method from
Apphud.purchasePromo(product, discountID: promoID) { (subsription, error) in ...}
toApphud.purchasePromo(product, discountID: promoID) { result in ...}
. You will findsubscription
anderror
objects inside newApphudPurchaseResult
object. - ⚡️ Update method from
Apphud.restoreSubscriptions { subscriptions, error in ...}
toApphud.restorePurchases { subscriptions, purchases, error in ...}
. - ⚡️ Update method from
Apphud.migrateSubscriptionsIfNeeded { subscriptions in ...}
toApphud.migratePurchasesIfNeeded { subscriptions, purchases, error in ...}
.