SKProducts, if configured in Apphud Products Hub. Returns
nilif StoreKit products are not yet fetched from the App Store. To get notified when paywalls are ready to use, use
paywallsDidLoadCallback– when it’s called, paywalls are populated with their
ApphudPaywallcontains the list of products
[ApphudProducts], paywall’s identifier, and several other properties. To show Products in your app you need to get a Paywall by its identifier.
nilat launch. It takes some time to fetch product identifiers from Apphud and later load
SKProductsfrom StoreKit. To get notified when products are loaded, use any of the following:
productsDidFetchCallback(_ callback: @escaping ([SKProduct]) -> Void)method.
products: [SKProduct])delegate method of
refreshStoreKitProducts(_ callback: (([SKProduct]) -> Void)?)method. A new request will be sent to the App Store for fetching
SKProductseven if initial request is still loading. So you should only use this method as a fallback in your UI. See
Apphud.swiftfile for details.
ApphudPurchaseResultobject, which contains subscription model with all info about your subscription.
ApphudPurchaseResultmay also contain
nonRenewingPurchaseobjects in case user purchased non-renewing purchase. See
ApphudSubscription.swiftfiles for details.
trueif user has active subscription. Use this method to determine whether to unlock premium functionality to the user.
ApphudSubscription.swiftfile for details.
falseif was never purchased or is refunded.
SKPaymentQueue.default().restoreCompletedTransactions(), then you have nothing to worry about: Apphud SDK will automatically intercept and send the latest App Store Receipt to Apphud servers when your restoration is completed. However, better to call our restore method from SDK:
nil, if subscriptions are never purchased), non-renewing purchases (or
nil, if there are no any) and an optional error.
nilthen a payment will not start; you can also save the product and return nil to initiate a payment later by yourself. You can also read Apple documentation for details.