Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paywalls manually handle purchases, finishTransactions/ObserverMode -> PurchasesAreCompletedBy #3917

Closed
wants to merge 78 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2538c2a
Initial commit
joshdholtz May 24, 2024
4b3d0e7
Paywalls - Allow developers to handle purchase logic
joshdholtz May 24, 2024
d914925
Merge branch 'main' of https://github.com/RevenueCat/purchases-ios in…
jamesrb1 May 27, 2024
1e3b3f8
Use `HandlePurchaseComplete` directly
jamesrb1 May 27, 2024
472a177
Rename callback; Better documentation
jamesrb1 May 28, 2024
fb29c58
Debug log
jamesrb1 May 28, 2024
6a383dc
Fix tests; make `finishTransactions` configurable in mock `PurchaseHa…
jamesrb1 May 28, 2024
839d83a
Remove foundation import
jamesrb1 May 28, 2024
1ee8110
Test PaywallView().handlePurchase { … }
jamesrb1 May 28, 2024
18a6db3
WIP handle external restore logic
jamesrb1 May 29, 2024
a5214c8
Missing from last commit
jamesrb1 May 29, 2024
f642ffa
Only call restore once!
jamesrb1 May 29, 2024
95cafb7
No need to be optional
jamesrb1 May 29, 2024
52faa87
No need for explicit initializer
jamesrb1 May 29, 2024
3a282e8
Ability to pass restore result back
jamesrb1 May 29, 2024
e5e0e07
Better error handling
jamesrb1 May 29, 2024
2244b8e
Naming
jamesrb1 May 29, 2024
094722c
correct label
jamesrb1 May 29, 2024
1b8390a
Test restore
jamesrb1 May 29, 2024
3cdc95f
Documentation
jamesrb1 May 29, 2024
8532e33
More logging
jamesrb1 May 29, 2024
b7adeb0
Linting
jamesrb1 May 29, 2024
9d7099e
Code organization
jamesrb1 May 29, 2024
c205d5f
Tweaks
jamesrb1 May 29, 2024
45b4425
Lint
jamesrb1 May 29, 2024
534cc83
Update test method name
jamesrb1 May 29, 2024
122d2c2
Change name from `finishTransactions` to `purchasesAreCompletedBy`
jamesrb1 May 30, 2024
5c4809e
Switch `purchasesAreCompletedBy` to enum type.
jamesrb1 May 30, 2024
d816856
Use new enum
jamesrb1 May 30, 2024
7047521
Update test purchase handler
jamesrb1 May 30, 2024
5a0718d
Documentation update
jamesrb1 May 30, 2024
57ec3ab
More informative debug log.
jamesrb1 May 30, 2024
f526e83
Add a “.” to the end of the sentence….
jamesrb1 May 30, 2024
2d2f2ee
Documentation.
jamesrb1 May 30, 2024
df3e1d9
Lint
jamesrb1 May 30, 2024
6de881e
API Test
jamesrb1 May 30, 2024
262daf6
Test fixes
jamesrb1 May 30, 2024
46c84e0
Test updates
jamesrb1 May 30, 2024
5bd6065
API test
jamesrb1 May 30, 2024
2f59d3d
Functional cmbination single handler; needs cleanup
jamesrb1 May 31, 2024
5ef84fa
Tidy, consolidate, rename
jamesrb1 May 31, 2024
4a02670
typo
jamesrb1 May 31, 2024
be00392
Documentation
jamesrb1 May 31, 2024
c51d92e
Documentation
jamesrb1 May 31, 2024
9ed38e3
naming
jamesrb1 May 31, 2024
436ae86
Name and type
jamesrb1 May 31, 2024
6d0ad58
naming
jamesrb1 May 31, 2024
edccb80
Documentation
jamesrb1 May 31, 2024
e411c2e
Improve public API with labels
jamesrb1 May 31, 2024
02c266d
Missing from last commit
jamesrb1 May 31, 2024
fab7581
Improve public API
jamesrb1 May 31, 2024
b4ace48
Improve Public API
jamesrb1 May 31, 2024
0899a38
Docs
jamesrb1 May 31, 2024
63942c1
Docs
jamesrb1 May 31, 2024
dd5d32f
Docs and naming
jamesrb1 May 31, 2024
539062a
🤷‍♂️
jamesrb1 May 31, 2024
fa14695
Fix tests
jamesrb1 May 31, 2024
9763b72
Linter stuff
jamesrb1 May 31, 2024
ac65d2f
Missing name change
jamesrb1 May 31, 2024
be0b23b
Documentation
jamesrb1 May 31, 2024
0bfa9db
More documentation
jamesrb1 May 31, 2024
b43f77e
Code review doc fixes
jamesrb1 Jun 6, 2024
7da678d
if -> switch
jamesrb1 Jun 6, 2024
5aa3730
Move defer
jamesrb1 Jun 6, 2024
604ea4f
Remove public access modifier
jamesrb1 Jun 6, 2024
ce8b8e0
Add error logging if callback is `nil`
jamesrb1 Jun 6, 2024
40c0685
Deprecate `observerMode` from public APIs, replace with `purchasesAre…
jamesrb1 Jun 7, 2024
bd7bbf3
Return pre-processor marker
jamesrb1 Jun 7, 2024
f30bd1f
fix preprocessor
jamesrb1 Jun 7, 2024
ef9526f
Add API tests
jamesrb1 Jun 7, 2024
1df2679
Documentation wording
jamesrb1 Jun 7, 2024
256a450
Obj-C API Tests
jamesrb1 Jun 7, 2024
37b3cb9
Merge branch 'paywalls-manually-handle-purchases' of https://github.c…
jamesrb1 Jun 7, 2024
f12f20e
Lint
jamesrb1 Jun 7, 2024
6911c38
Fix unit tests
jamesrb1 Jun 7, 2024
faf226b
Fix build (I guess our build machines use old versions of Swift?)
jamesrb1 Jun 7, 2024
07ef349
More old swift compatibility
jamesrb1 Jun 7, 2024
b2fc2e2
CustomEntitlementComputation API Tester update
jamesrb1 Jun 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move defer
jamesrb1 committed Jun 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5aa37308c48393e1f4c2e2ac794a2882d7153578
10 changes: 5 additions & 5 deletions RevenueCatUI/Purchasing/PurchaseHandler.swift
Original file line number Diff line number Diff line change
@@ -269,6 +269,11 @@ extension PurchaseHandler {
func performExternalRestoreLogic() async throws -> (info: CustomerInfo, success: Bool) {
Logger.debug(Strings.executing_external_restore_logic)

defer {
self.restoreInProgress = false
self.actionInProgress = false
}

self.restoreInProgress = true
self.restoredCustomerInfo = nil
self.restoreError = nil
@@ -281,11 +286,6 @@ extension PurchaseHandler {

self.startAction()

defer {
self.restoreInProgress = false
self.actionInProgress = false
}

let success = try await withCheckedThrowingContinuation { continuation in
externalRestorePurchaseContinuation = continuation
}