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

Integrate the StoreKit2 purchase method #10

Merged
merged 27 commits into from
Jan 5, 2024
Merged

Conversation

nik3212
Copy link
Member

@nik3212 nik3212 commented Dec 11, 2023

No description provided.

- Create an `ISKProduct` interface that describes a common `StoreKit` object
- Create `SK1StoreProduct` and `SK2StoreProduct` classes that describe products for StoreKit and StoreKit2, respectively
@nik3212 nik3212 self-assigned this Dec 11, 2023
@spacecode-github-bot
Copy link

spacecode-github-bot commented Dec 11, 2023

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

Currently, a `ProductProvider` provides the ability to fetch products via the new `StoreKit` API. If the current OS version is higher than iOS 15, tvOS 15, watchOS 8, macOS 12, the new API can be used when calling `fetch(_:) async throws -> [StoreProduct]`; otherwise, the old API will be called.

Additionally, this commit includes:

- Remove unnecessary access control modifiers
- Write code comments and provide usage examples
- Write comments for the `IAPProvider`
- Write comments for the `ReceiptRefreshProvider`
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 376 lines in your changes are missing coverage. Please review.

Comparison is base (96b1786) 95.21% compared to head (6124451) 61.49%.

Additional details and impacted files
@@             Coverage Diff             @@
##              dev      #10       +/-   ##
===========================================
- Coverage   95.21%   61.49%   -33.72%     
===========================================
  Files          15       28       +13     
  Lines         564     1018      +454     
===========================================
+ Hits          537      626       +89     
- Misses         27      392      +365     
Files Coverage Δ
...ces/Flare/Classes/Helpers/Async/AsyncHandler.swift 100.00% <100.00%> (ø)
...es/Providers/PaymentProvider/PaymentProvider.swift 99.04% <ø> (+0.01%) ⬆️
...eceiptRefreshProvider/ReceiptRefreshProvider.swift 100.00% <ø> (ø)
...sses/Providers/RefundProvider/RefundProvider.swift 100.00% <ø> (+3.23%) ⬆️
...s/Helpers/AsyncSequence/AsyncSequence+Stream.swift 66.67% <66.67%> (ø)
Sources/Flare/Flare.swift 96.72% <89.47%> (-3.28%) ⬇️
...elpers/PaymentTransaction/PaymentTransaction.swift 89.80% <0.00%> (-5.86%) ⬇️
Sources/Flare/Classes/Models/IAPError.swift 88.89% <85.71%> (+0.65%) ⬆️
...es/Providers/ProductProvider/ProductProvider.swift 94.00% <25.00%> (-6.00%) ⬇️
...lasses/Extensions/Locale/Locale+CurrencyCode.swift 0.00% <0.00%> (ø)
... and 13 more

... and 3 files with indirect coverage changes

@nik3212 nik3212 added the enhancement New feature or request label Dec 18, 2023
- Update `Flare.xcscheme`
- Update `test_thatIAPProviderFetchesSK2Products_whenProductsAreAvailable` test
The `StoreTransaction` model is a wrapper for both `SK1StoreTransaction` and `SK2StoreTransaction`
The `StoreTransaction` object serves as a wrapper for both `SKTransaction` and `StoreKit.Transaction`.
Replace purchasing a product by ID with passing a product object.
A host app provides a means to test in-app purchases using the StoreKit2 API.
- Write unit tests for the new methods
- Improve the readability of the existing test cases
@nik3212 nik3212 force-pushed the feature/purchase-store-kit-2 branch 8 times, most recently from 834abf0 to f3da71a Compare December 29, 2023 12:41
- Implement testing on different OS versions
- Temporarily drop testing on watchOS
- Update the GitHub Actions CI script to enable testing on various platforms
@nik3212 nik3212 force-pushed the feature/purchase-store-kit-2 branch 19 times, most recently from 006329b to 4d1b405 Compare January 2, 2024 11:16
@nik3212 nik3212 force-pushed the feature/purchase-store-kit-2 branch from 4d1b405 to 2f3d1bc Compare January 2, 2024 13:12
@nik3212 nik3212 changed the title [WIP] Integrate the StoreKit2 purchase method Integrate the StoreKit2 purchase method Jan 5, 2024
@nik3212 nik3212 merged commit d64f9b9 into dev Jan 5, 2024
18 of 20 checks passed
@nik3212 nik3212 deleted the feature/purchase-store-kit-2 branch January 5, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants