-
Notifications
You must be signed in to change notification settings - Fork 316
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
[SK2] Add Configuration.with(storeKitVersion:)
to select the version of StoreKit to use
#3487
Merged
Merged
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4886d77
Add Configuration.with(storeKitVersion:) to select the version of Sto…
MarkVillacampa cb88d35
fix tests
MarkVillacampa a98060c
fix tests
MarkVillacampa 49a3517
fix tests
MarkVillacampa e06da0c
fix tests
MarkVillacampa bfac38d
Remove StoreKit2Setting
MarkVillacampa 252093f
Use stronger type
MarkVillacampa 89a68b9
rename debugDescription to effectiveVersion
MarkVillacampa 9e1ab81
use isStoreKit2EnabledAndAvailable
MarkVillacampa b5a2efb
make default immutable
MarkVillacampa bc0561e
remove swiftpm file
MarkVillacampa 4430da5
remove old storekit 2 log
MarkVillacampa 323e366
separate effectiveVersion and debugDescription
MarkVillacampa d8b5f76
Generalize In-App Purchase Key error message
MarkVillacampa 8f0b5ab
lint
MarkVillacampa 0c642d4
add X-StoreKit-Version header test
MarkVillacampa 871e787
re-add comment
MarkVillacampa d4f683e
dont run test on ios 14
MarkVillacampa 67abfbd
Improve StoreKit enum documentation
MarkVillacampa 96b81cf
Add StoreKitVersion api tests
MarkVillacampa 8a8a4ab
Set explicit int values for StoreKitVersion enum
MarkVillacampa 4f72f4d
fixes
MarkVillacampa 0e854bb
fix
MarkVillacampa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ public extension Purchases { | |
appUserID: appUserID, | ||
observerMode: observerMode, | ||
userDefaults: userDefaults, | ||
useStoreKit2IfAvailable: StoreKit2Setting.default.usesStoreKit2IfAvailable | ||
useStoreKit2IfAvailable: StoreKitVersion.default == .storeKit2 | ||
) | ||
} | ||
|
||
|
@@ -118,7 +118,7 @@ public extension Purchases { | |
userDefaults: userDefaults, | ||
platformInfo: nil, | ||
responseVerificationMode: .default, | ||
storeKit2Setting: .init(useStoreKit2IfAvailable: useStoreKit2IfAvailable), | ||
storeKitVersion: useStoreKit2IfAvailable ? .storeKit2 : .default, | ||
storeKitTimeout: Configuration.storeKitRequestTimeoutDefault, | ||
networkTimeout: Configuration.networkTimeoutDefault, | ||
dangerousSettings: dangerousSettings, | ||
|
@@ -403,24 +403,9 @@ extension CustomerInfo { | |
|
||
public extension Configuration.Builder { | ||
|
||
/// Set `storeKit2Setting`. If `true`, the SDK will use StoreKit 2 APIs internally. If disabled, it will use StoreKit 1 APIs instead. | ||
/// - Parameter usesStoreKit2IfAvailable: enable StoreKit 2 on devices that support it. | ||
/// Defaults to `false`. | ||
/// - Important: This configuration flag has been deprecated, and will be replaced by automatic remote configuration in the future. | ||
/// However, apps using it should work correctly. | ||
/// | ||
@available(*, deprecated, message: """ | ||
RevenueCat currently uses StoreKit 1 for purchases, as its stability in production scenarios has | ||
proven to be more performant than StoreKit 2. | ||
|
||
We're collecting more data on the best approach, but StoreKit 1 vs StoreKit 2 is an implementation detail | ||
that you shouldn't need to care about. | ||
|
||
Simply remove this method call to let RevenueCat decide for you which StoreKit implementation to use. | ||
""") | ||
@available(*, deprecated, message: "Use .with(storeKitVersion:) to enable StoreKit 2") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <3 |
||
@objc func with(usesStoreKit2IfAvailable: Bool) -> Configuration.Builder { | ||
self.storeKit2Setting = .init(useStoreKit2IfAvailable: usesStoreKit2IfAvailable) | ||
return self | ||
return self.with(storeKitVersion: usesStoreKit2IfAvailable ? .storeKit2 : StoreKitVersion.default) | ||
} | ||
|
||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is deprecated, but should this be
If you pass
false
, it might still use it SK2 if/when that becomes the default.