Releases: apphud/ApphudSDK
Releases · apphud/ApphudSDK
0.9.0
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 ...}
.
0.8.5
What's new in 0.8.5:
- Added new ApphudUIDelegate method
func apphudShouldPerformRule(rule: ApphudRule) -> Bool
. See Apphud.swift for method explanation. - (Attention!) Renamed ApphudUIDelegate method to
func apphudShouldShowScreen(screenName: String) -> Bool
. Don't forget to update this method parameter, if you were using it. - Added Adjust support.
- Renamed
func restoreSubscriptions(callback: @escaping ([ApphudSubscription]?, Error?) -> Void)
. AddedError?
parameter. - Improved logic for
func migrateSubscriptionsIfNeeded
method. - Pretty printed logs.
- Fixed bug with user id being changed sometimes.
- User ID is now saved to Keychain, so after re-install it is restored.
- Fixed bug with push opened event not being sent in some cases.
- Add rule name and screen name to delegate methods.
- Add more logs.
0.8
What's new in 0.8:
- New Rules support. Old rules (win back lapsed subscribers, billing issue) are deprecated and no longer supported since this SDK version. When upgrading to this SDK version, you should create your new screens and rules in web dashboard. If you need help with SDK upgrade, please contact us: https://apphud.com/contacts
- Method
func submitReceipt(_ productIdentifier : String, _ callback : ((ApphudSubscription?, Error?) -> Void)?)
is now deprecated. You don't need to call it anymore, as starting now Apphud SDK automatically tracks all your in-app purchases and submits App Store receipt to Apphud. If you were using callback from this method, you can useapphudSubscriptionsUpdated
delegate method instead; - Added new protocol
ApphudUIDelegate
with screen controller delegate methods; - Delete method
func apphudScreenPresentationStyle(controller: UIViewController) -> UIModalPresentationStyle
is moved fromApphudDelegate
to new protocolApphudUIDelegate
; - Added new method
func showPendingScreen()
to present Apphud screen that was delayed (i.e. returnedfalse
) inapphudShouldShowScreen
delegate method; - Added new method
func migrateSubscriptionsIfNeeded(callback: @escaping ([ApphudSubscription]?) -> Void)
which helps you to migrate existing subscribers into Apphud. Useful when adding Apphud SDK to live app. - Other minor bug fixes and improvements.
0.7.5
0.7.4
What's new in 0.7.4:
- Added new method
func setIntegrationsTestMode()
. If this method is called, Apphud will send all subscription events of current user to your test analytics, if test api keys are set in integrations dashboard. - Improved SDK initialization logic
0.7.3
What's new in 0.7.3:
- Added new method
func addAttribution(data: [AnyHashable : Any], from provider: ApphudAttributionProvider, identifer: String? = nil, callback: ApphudBoolCallback?)
. Use this method to submit attribution data from your attribution provider. - Added new method
func didFetchProductsNotification() -> Notification.Name
. Add observer to this notification name to get notified when SKProducts are fetched from StoreKit. - Added new method
func products() -> [SKProduct]?
. Returns array ofSKProduct
objects fetched from StoreKit. Now you don't have to fetch and store products for yourself. - Callback in
func submitPushNotificationsToken(token: Data, callback: ApphudBoolCallback?)
method is now optional. - Method
func purchase(product: SKProduct, callback: ((ApphudSubscription?, Error?) -> Void)?)
renamed to more lightweightfunc purchase(_ product: SKProduct, callback: ((ApphudSubscription?, Error?) -> Void)?)
.
0.6.8
0.6.7
0.6.5
What's new in Apphud SDK 0.6.5
- Added
func apphudScreenPresentationStyle() -> UIModalPresentationStyle
delegate method to make control presentation style of Apphud controller. This is useful since iOS 13 presents in page sheet style by default. Now you can make it full screen. - Added two more delegate methods that help to control present/dismiss actions of Apphud controller
- Improved
apphudSubscriptionsUpdated
delegate method. Updated documentation.
0.6.3
What's new in Apphud SDK 0.6.3
- Added a callback to restore subscriptions method:
Apphud.restoreSubscriptions(callback: @escaping ([ApphudSubscription]?) -> Void)
- Method
Apphud.purchasedSubscription()
renamed toApphud.subscription()
to avoid misleading. - Method
Apphud.purchasedSubscriptions()
renamed toApphud.subscriptions()
to avoid misleading. - Added new
Apphud.hasActiveSubscription()-> Bool
method which returns boolean value. Use this method to determine whether or not to unlock premium functionality to the user. - Added new delegate method
apphudDidFetchStoreKitProducts(_ products: [SKProduct])
which returns array of StoreKit products that you added in Apphud. Now you don't need to fetch products from StoreKit for yourself. - Documentation in many SDK methods has been improved to avoid misleading.