Skip to content

Commit

Permalink
[Paywall] Fix restoreStarted not being called on `presentPaywallIfNee…
Browse files Browse the repository at this point in the history
…ded` when using `requiredEntitlementIdentifier` (#4223)

### Motivation

`restoreStarted` callback was not being fired on
`presentPaywallIfNeeded` when using `requiredEntitlementIdentifier`

### Description

We weren't doing anything with the `restoreStarted` argument 🤦‍♂️ Now
its getting passed along and gets called 💪

**BONUS:** Fixed two more that were missing in the footer (thanks
@jamesrb1 🙌 )

⚠️ We don't _really_ have a great way to test this right now 😬 All of
our existing tests use the call some internal things so we can pass
mocked customer info and intro eligibility checkers. So this didn't get
caught earlier because its one level above those internal methods that
do most of the testing.
  • Loading branch information
joshdholtz authored Aug 27, 2024
1 parent 2a6def5 commit c6a826f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions RevenueCatUI/View+PresentPaywall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ extension View {
purchaseStarted: purchaseStarted,
purchaseCompleted: purchaseCompleted,
purchaseCancelled: purchaseCancelled,
restoreStarted: restoreStarted,
restoreCompleted: restoreCompleted,
purchaseFailure: purchaseFailure,
restoreFailure: restoreFailure,
Expand Down
3 changes: 2 additions & 1 deletion RevenueCatUI/View+PresentPaywallFooter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ extension View {
purchaseStarted: purchaseStarted,
purchaseCompleted: purchaseCompleted,
purchaseCancelled: purchaseCancelled,
restoreStarted: restoreStarted,
restoreCompleted: restoreCompleted,
purchaseFailure: purchaseFailure,
restoreFailure: restoreFailure
Expand Down Expand Up @@ -192,7 +193,7 @@ extension View {
purchaseStarted: purchaseStarted,
purchaseCompleted: purchaseCompleted,
purchaseCancelled: purchaseCancelled,
restoreStarted: nil,
restoreStarted: restoreStarted,
restoreCompleted: restoreCompleted,
purchaseFailure: purchaseFailure,
restoreFailure: restoreFailure
Expand Down

0 comments on commit c6a826f

Please sign in to comment.