Skip to content

Commit

Permalink
Changed StoreKit2Setting.default back to `.enabledOnlyForOptimizati…
Browse files Browse the repository at this point in the history
…ons` (#2022)

This changes the default back to `StoreKit 1`. We decided to do this for
the following reasons:
- Purchasing with `PromotionalOffer`s does not work with StoreKit 2 due
to an Apple bug (see
#2020 (comment))
- `checkTrialOrIntroDiscountEligibility` is significantly slower with
`StoreKit 2` (#1893). We're adding optimizations to help with that
(#2007), but the underlying logic will still be slow.
- A rare race-condition where `StoreKit 2` does not have transactions
after a purchase ([TRIAGE-82]). We have some workarounds (#1945), but
it's still being investigated.

_Note: This effectively reverts 0ee540a. That commit made it easier to
only change the default in one place which is why this PR is basically
just one line._

[TRIAGE-82]:
https://revenuecats.atlassian.net/browse/TRIAGE-82?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
NachoSoto authored Nov 4, 2022
1 parent a65c1da commit 299e952
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Misc/StoreKit2Setting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension StoreKit2Setting {
: .enabledOnlyForOptimizations
}

static let `default`: Self = .enabledForCompatibleDevices
static let `default`: Self = .enabledOnlyForOptimizations

}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Purchasing/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ import Foundation

/**
* Set `usesStoreKit2IfAvailable`.
* - Parameter usesStoreKit2IfAvailable: opt out of using StoreKit 2 on devices that support it.
* Defaults to `true`.
* - Parameter usesStoreKit2IfAvailable: opt in using StoreKit 2 on devices that support it.
* Defaults to `false`.
*/
@objc public func with(usesStoreKit2IfAvailable: Bool) -> Builder {
self.storeKit2Setting = .init(useStoreKit2IfAvailable: usesStoreKit2IfAvailable)
Expand Down

0 comments on commit 299e952

Please sign in to comment.