Commit Graph
8 Commits
Author SHA1 Message Date
Will Taylorandandy boedo 41246f18de Replace withCheckedThrowingContinuation Calls With withUnsafeThrowingContinuation (#4286)
* replace withCheckedThrowingContinuation calls with withUnsafeThrowingContinuation

* replaced instances of withCheckedContinuation -> withUnsafeContinuation

* update the links in comments to point to the issue not the PR

* linting

---------

Co-authored-by: andy boedo <andresboedo@gmail.com>
2024-09-18 11:54:00 -03:00
NachoSoto 2bcd0ce328 5.0.0 changes: support SK2 by default 2024-07-01 14:37:21 -05:00
32c63cdb46 [SK2] Add support for StoreKit Config files in SK2 (#3365)
When using StoreKit Config file, we do not have access to the
transaction history or subscription status server-side.

To work around this, we introduce a new `StoreKit2Receipt` type that
closely resembles the structure of an SK1 receipt and contains all the
transaction history and subscription status for the customer. It can be
sent in a single request to `/receipt`

---------

Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com>
Co-authored-by: Distiller <distiller@static.38.39.183.137.cyberlynk.net>
Co-authored-by: Distiller <distiller@static.38.23.40.89.cyberlynk.net>
Co-authored-by: Distiller <distiller@static.38.39.185.65.cyberlynk.net>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
2023-12-13 17:00:37 +01:00
NachoSoto ac185188ae StoreKit2TransactionListener: handle transactions asynchronously (#2910)
Currently when launching an app in SK1 mode, if there are multiple
transactions in the queue, we handle them all and begin operations in
parallel. If the cache keys are the same, those end up being a combined
POST receipt request.

However with `StoreKit 2`, because we were waiting to handle each one of
the `StoreKit.Transaction.updates` using `await`, we ended up posting
them all sequentially, instead of relying on `CallbackCache`.

This also adds a lot more coverage for `StoreKit2TransactionListener` to
verify this behavior.
2023-08-07 16:43:50 -07:00
NachoSoto 094e8f2aad Extracted and tested AsyncSequence.extractValues (#2538) 2023-05-25 07:14:58 -07:00
NachoSoto 217fe82409 Async.call: added non-throwing overload (#2006)
This will be used by an upcoming PR.
2022-11-07 12:40:12 -08:00
NachoSoto b981e0fa4b Async.call method to convert completion-block call to async (#1969)
This simplifies calling completion-block APIs as `async`. The opposite
of what #1943 introduced.
2022-10-10 08:36:15 -07:00
NachoSoto 46ac7598fc Abstracted conversion from async to completion-block APIs (#1943)
Created `Async` with some shared methods that make this conversion
simpler in a type-safe way.

Helps turn this:
```swift
_ = Task<Void, Never> {
    do {
        completion(.success(try await f()))
    } catch {
        completion(.failure(ErrorUtils.error())
    }
}
```

Into this:
```swift
Async.call(with: completion) {
    try await f()
}
```
2022-09-28 08:40:59 -07:00