Skip to content

Paywalls: new .onPurchaseStarted modifier#3627

Merged
NachoSoto merged 1 commit into
mainfrom
paywalls-purchase-started
Feb 3, 2024
Merged

Paywalls: new .onPurchaseStarted modifier#3627
NachoSoto merged 1 commit into
mainfrom
paywalls-purchase-started

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

Similar to #3622.

This API is available in:

  • PaywallView()
  • .presentPaywallIfNeeded
  • .paywallFooter
  • PaywallViewControllerDelegate

Similar to #3622.

This API is available in:
- `.presentPaywallIfNeeded`
- `.paywallFooter`
- `PaywallView()`
- `PaywallViewControllerDelegate`
@NachoSoto NachoSoto requested review from a team February 2, 2024 19:43
Comment on lines +81 to +108
func testInProgressPropertiesDuringPurchase() async throws {
self.continueAfterFailure = false

let asyncHandler = AsyncPurchaseHandler()
let handler = asyncHandler.purchaseHandler!

let task = Task.detached {
_ = try await handler.purchase(package: TestData.packageWithIntroOffer)
}

try await asyncWait {
handler.actionInProgress && handler.purchaseInProgress
}

expect(handler.purchaseInProgress) == true
expect(handler.actionInProgress) == true

// Finish purchase
try asyncHandler.resume()

// Wait for purchase task to complete
_ = try await task.value

expect(handler.purchaseInProgress) == false
expect(handler.actionInProgress) == false
}

func testInProgressPropertiesDuringRestore() async throws {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 tests verify actionInProgress and the new purchaseInProgress.

@NachoSoto NachoSoto enabled auto-merge (squash) February 2, 2024 19:53
@NachoSoto NachoSoto merged commit 4735b6b into main Feb 3, 2024
@NachoSoto NachoSoto deleted the paywalls-purchase-started branch February 3, 2024 00:37
vegaro added a commit that referenced this pull request Feb 19, 2024
Similar to #3627.

This API is available in:
- `PaywallView()`
- `.presentPaywallIfNeeded`
- `.paywallFooter`
- `PaywallViewControllerDelegate`

---------

Co-authored-by: Mark Villacampa <m@markvillacampa.com>
vegaro added a commit that referenced this pull request Feb 21, 2024
Similar to #3627.

This API is available in:
- `PaywallView()`
- `.presentPaywallIfNeeded`
- `.paywallFooter`
- `PaywallViewControllerDelegate`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants