-
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
HTTPClient
: replaced X-StoreKit2-Setting
with X-StoreKit2-Enabled
#2118
Conversation
@@ -60,6 +60,11 @@ extension StoreKit2Setting { | |||
|
|||
/// - Returns: `true` iff SK2 is enabled and it's available. | |||
var shouldOnlyUseStoreKit2: Bool { |
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 decided to keep this other property too because it has slightly different implications, even if it has the same implementation (right now).
This is used to determine whether to not enable SK1 stuff (see #1882 for example).
return self.isEnabledAndAvailable | ||
} | ||
|
||
/// - Returns: `true` iff SK2 is enabled and it's available. |
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.
/// - Returns: `true` iff SK2 is enabled and it's available. | |
/// - Returns: `true` if SK2 is enabled and it's available. |
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.
iff
is not a typo, it means "if and only if": https://simple.wikipedia.org/wiki/If_and_only_if
I left some questions in the khepri PR, but general thoughts:
|
Yeah I wish we had done this originally :/ I feel like long term we should deprecate the other one. If anything changes in iOS I think the SDK is better suited to determine what's actually running and it seems scary to put that logic in the backend. In the short term I agree that we should do that to fox promo purchases for existing users though. Since we're gonna do that, should we just close this? |
Oh but as we discussed we need a client-side fix anyway for base64, so maybe this would be less risky that comparing version numbers? |
Well I agree it might be better to not introduce a new header. I'll close this then. |
if it ended up being impossible to fix older versions through a backend patch, then I'd vote for killing the old header in favor of the new one, I don't think it's currently used for anything |
This will be used for https://github.com/RevenueCat/khepri/pull/4843, to fix [SDKONCALL-160] and #2020.
HTTPClient
: added X-StoreKit2-Enabled
headerHTTPClient
: replaced X-StoreKit2-Setting
with X-StoreKit2-Enabled
8a522ee
to
767c1bd
Compare
Okay updated this to replace the header instead. |
Fixes [SDKONCALL-160], [SDKONCALL-182], #2114, and RevenueCat/react-native-purchases#455. Depends on #2118 and https://github.com/RevenueCat/khepri/pull/4843 / https://github.com/RevenueCat/khepri/pull/4852. ## Changes: - Base64decode `signature` - Fixed signature on backend for SK2: https://github.com/RevenueCat/khepri/pull/4843 / https://github.com/RevenueCat/khepri/pull/4852 - Added tests - Added specific error if signature can't be decoded: > [Purchases] - ERROR: 😿‼️ The information associated with this PromotionalOffer is not valid. See https://rev.cat/ios-subscription-offers for more info. The signature generated by RevenueCat could not be decoded: signature 914 [SDKONCALL-160]: https://revenuecats.atlassian.net/browse/SDKONCALL-160?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [SDKONCALL-182]: https://revenuecats.atlassian.net/browse/SDKONCALL-182?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This will be used for https://github.com/RevenueCat/khepri/pull/4843, to fix SDKONCALL-160 and #2020.
X-StoreKit2-Setting
only told us if the apps had that setting enabled. However, when running on an older device,SK2
would still be disabled.