Moves back to using Superwall.shared.identify(userId: userId) and reset() instead of logIn/createAccount/logout/reset. This is so that it's easier for integration. However, you can now pass an IdentityOptions object to identify(userId:options). This should only be used in advanced use cases. By setting the restorePaywallAssignments property of IdentityOptions to true, it prevents paywalls from showing until after paywall assignments have been restored. If you expect users of your app to switch accounts or delete/reinstall a lot, you'd set this when identifying an existing account.
Enhancements
Adds hasActiveSubscriptionDidChange(to:) delegate function. If you're letting Superwall handle subscription logic you can use this to receive a callback whenever the user's internal subscription status changes. You can also listen to the published hasActiveSubscription variable.
Adds a completion handler to Superwall.configure(...) that lets you know when Superwall has finished configuring. You can also listen to the published isConfigured variable.
If you let Superwall handle your subscription-related logic, we now assume that a non-consumable product on your paywall is a lifetime subscription. If not, you'll need to return a SubscriptionController from the delegate.
handleDeepLink(_:) now returns a discardable Bool indicating whether the deep link was handled. If you're using application(_:open:options:) you can return its value there.
Adds togglePaywallSpinner(isHidden:) to arbitrarily toggle the loading spinner on and off. This is particularly useful when you're doing async work when performing a custom action in handleCustomPaywallAction(withName:).
Fixes
Fixes occasional thread safety related crash when loading products.
Reverts a issue from the last beta where the paywall spinner would move up before the payment sheet appeared.
Updates sample app readmes.
Changes trigger in sample apps to be campaign_trigger to be inline with default trigger for new Superwall accounts.
Checklist
[x] All tests pass. Demo project builds and runs.
[x] I added tests, an experiment, or detailed why my change isn't tested.
[x] I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
[x] I have run swiftlint in the main directory and fixed any issues.
[ ] I have updated the SDK documentation as well as the online docs.
Changes in this pull request
Breaking Changes
Superwall.shared.identify(userId: userId)
andreset()
instead of logIn/createAccount/logout/reset. This is so that it's easier for integration. However, you can now pass anIdentityOptions
object toidentify(userId:options)
. This should only be used in advanced use cases. By setting therestorePaywallAssignments
property ofIdentityOptions
totrue
, it prevents paywalls from showing until after paywall assignments have been restored. If you expect users of your app to switch accounts or delete/reinstall a lot, you'd set this when identifying an existing account.Enhancements
hasActiveSubscriptionDidChange(to:)
delegate function. If you're letting Superwall handle subscription logic you can use this to receive a callback whenever the user's internal subscription status changes. You can also listen to the publishedhasActiveSubscription
variable.Superwall.configure(...)
that lets you know when Superwall has finished configuring. You can also listen to the publishedisConfigured
variable.SubscriptionController
from the delegate.handleDeepLink(_:)
now returns a discardableBool
indicating whether the deep link was handled. If you're usingapplication(_:open:options:)
you can return its value there.togglePaywallSpinner(isHidden:)
to arbitrarily toggle the loading spinner on and off. This is particularly useful when you're doing async work when performing a custom action inhandleCustomPaywallAction(withName:)
.Fixes
campaign_trigger
to be inline with default trigger for new Superwall accounts.Checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.swiftlint
in the main directory and fixed any issues.