PurchasesOrchestrator: removed lazy hack for properties with @available#1596
Merged
Conversation
12716c8 to
68378e2
Compare
Juanpe
reviewed
May 21, 2022
| @@ -66,11 +66,23 @@ class PurchasesOrchestrator { | |||
| private let beginRefundRequestHelper: BeginRefundRequestHelper | |||
| private let lock = NSRecursiveLock() | |||
|
|
|||
Contributor
There was a problem hiding this comment.
I think it's a great workaround, but another possible solution could be to create an object that encapsulates all this logic, something like StoreKit2Listeners without @available, and it's only initialised if StoreKit2 is available
Contributor
Author
There was a problem hiding this comment.
StoreKit2TransactionListener is already a wrapper, so that feels like creating a wrapper for a wrapper :P
68378e2 to
5a2deae
Compare
b5af2c1 to
dbf8a67
Compare
…ailable` Fixes [CF-682], and probably #1528. Looks like possibly something was broken demangling `lazy` properties with `@available` in iOS 15.0 (per the 2 bug reports). This changes the approach to simply having `Any?` as the value, and making the exposed `@available` property a derived one.
5a2deae to
fb460af
Compare
aboedo
approved these changes
May 26, 2022
Merged
NachoSoto
added a commit
that referenced
this pull request
Jun 2, 2022
### New Features * `Purchases.customerInfo()`: added overload with a new `CacheFetchPolicy` (#1608) via NachoSoto (@NachoSoto) * `Storefront`: added `sk1CurrentStorefront` for Objective-C (#1614) via NachoSoto (@NachoSoto) ### Bug Fixes * Fix for not being able to read receipts on watchOS (#1625) via Patrick Busch (@patrickbusch) ### Other Changes * Added tests for `PurchasesOrchestrator` invoking `listenForTransactions` only if SK2 is enabled (#1618) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: removed `lazy` hack for properties with `@available` (#1596) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator.purchase(sk2Product:promotionalOffer:)`: simplified implementation with new operator (#1602) via NachoSoto (@NachoSoto)
Closed
NachoSoto
added a commit
that referenced
this pull request
Jun 7, 2022
Fixes #1660 and [SDKONCALL-24]. This is the same approach used in #1596. [SDKONCALL-24]: https://revenuecats.atlassian.net/browse/SDKONCALL-24?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes CF-682, and probably #1528.
Looks like possibly something was broken demangling
lazyproperties with@availablein iOS 15.0 (per the 2 bug reports).This changes the approach to simply having
Any?as the value, and making the exposed@availableproperty a derived one.