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

xrOS: added support for new purchase(confirmIn:options:) method #2683

Merged
merged 2 commits into from
Jun 22, 2023

Conversation

NachoSoto
Copy link
Contributor

No description provided.

@NachoSoto NachoSoto added pr:fix A bug fix xrOS labels Jun 21, 2023
@NachoSoto NachoSoto requested a review from a team June 21, 2023 21:48
NachoSoto added a commit that referenced this pull request Jun 21, 2023
If we end up calling these methods with an existing `PurchasesError`, we'd end up creating an `.unknownError` instead of returning that.
This is actually needed for #2683, where the inside of the `do`/`catch` can throw a `PurchasesError`.
@NachoSoto NachoSoto force-pushed the xros-purchase-scene branch 2 times, most recently from ab62739 to 9d5585e Compare June 21, 2023 22:51
Comment on lines 462 to 463
result = try await sk2Product.purchase(confirmIn: try self.systemInfo.currentWindowScene,
options: options)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs #2686 to make sure we throw the correct error.

@NachoSoto NachoSoto force-pushed the xros-purchase-scene branch 2 times, most recently from 1d943fe to d5e19a9 Compare June 21, 2023 23:25
Comment on lines +509 to +510
// Note: this can be simplified as `#if swift(>=5.9) && os(xrOS)`
// once we drop support for Xcode 13.x
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the answer to your other question @tonidero @MarkVillacampa, I just didn’t want to duplicate this comment everywhere.

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Merging #2683 (9485463) into main (7298dfa) will increase coverage by 0.00%.
The diff coverage is 96.29%.

@@           Coverage Diff           @@
##             main    #2683   +/-   ##
=======================================
  Coverage   86.56%   86.57%           
=======================================
  Files         208      208           
  Lines       14801    14818   +17     
=======================================
+ Hits        12813    12829   +16     
- Misses       1988     1989    +1     
Impacted Files Coverage Δ
...ndationExtensions/UIApplication+RCExtensions.swift 93.33% <ø> (ø)
...s/Logging/Strings/ManageSubscriptionsStrings.swift 80.00% <ø> (+3.52%) ⬆️
Sources/Support/ManageSubscriptionsHelper.swift 69.69% <83.33%> (+1.65%) ⬆️
Sources/Misc/SystemInfo.swift 98.38% <100.00%> (+0.06%) ⬆️
...s/Purchasing/Purchases/PurchasesOrchestrator.swift 86.28% <100.00%> (+0.21%) ⬆️
Sources/Support/BeginRefundRequestHelper.swift 95.83% <100.00%> (+1.23%) ⬆️

... and 2 files with indirect coverage changes

@NachoSoto
Copy link
Contributor Author

NachoSoto commented Jun 22, 2023

Confirmed this works :)

@NachoSoto NachoSoto merged commit 4ab9d73 into main Jun 22, 2023
@NachoSoto NachoSoto deleted the xros-purchase-scene branch June 22, 2023 14:31
NachoSoto added a commit that referenced this pull request Jun 22, 2023
This was missing in #2683, these methods need to be invoked from the `@MainActor`.
NachoSoto added a commit that referenced this pull request Jun 22, 2023
### Dependencies:

- #2680
- #2681
- #2683

### Future changes:
- [x] Enable for `PurchaseTester`: #2685
- [ ] Build this target in `CI`
- [ ] Run tests on `xrOS`
NachoSoto added a commit that referenced this pull request Jun 22, 2023
This was missing in #2683, these methods need to be invoked from the
`@MainActor`.
NachoSoto pushed a commit that referenced this pull request Jun 22, 2023
**This is an automatic release.**

_This release is compatible with `Xcode 15 beta 2` and `visionOS beta
1`_

### New Features
* `xrOS`: added to list of supported platforms (#2682) via NachoSoto
(@NachoSoto)
### Bugfixes
* `xrOS`: fixed compilation by disabling debug overlay (#2681) via
NachoSoto (@NachoSoto)
* `xrOS`: added support for new `purchase(confirmIn:options:)` method
(#2683) via NachoSoto (@NachoSoto)
* `Xcode 15`: handle `Locale.currencyCode` deprecation (#2680) via
NachoSoto (@NachoSoto)
### Other Changes
* `PurchaseTester`: fixed release compilation (#2689) via NachoSoto
(@NachoSoto)
* `xrOS`: fixed runtime warning (#2691) via NachoSoto (@NachoSoto)
* `xrOS`: added support to `PurchaseTester` (#2685) via NachoSoto
(@NachoSoto)
* `Signature Verification`: new `Integration Tests` (#2642) via
NachoSoto (@NachoSoto)
* `ErrorUtils`: handle `PurchasesError` to avoid creating unknown errors
(#2686) via NachoSoto (@NachoSoto)
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