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
Adds presentCodeRedemptionSheet #400
Conversation
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.
thanks for taking care of this!
if (@available(iOS 14.0, *)) { | ||
[self.paymentQueue presentCodeRedemptionSheet]; | ||
} else { | ||
// Fallback on earlier versions |
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.
let's log a warning here saying that presentCodeRedemptionSheet
was attempted, but isn't available on this device, for debugging purposes.
I set 3.8.0 as the release version for this one, let's chat about logistics since might still need some updates to the programmatic restore method |
Still haven't been able to test. I'll try again today, hopefully they have propagated and the codes work today |
I don't think there's anything more to do sdk-wise, though, so I'd be fine with merging |
Yes, I agree. I am just worried about releasing this if we haven't been able to test the backend |
@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
|
|||
- (void)addPayment:(SKPayment *)payment; | |||
- (void)finishTransaction:(SKPaymentTransaction *)transaction; | |||
- (void)presentCodeRedemptionSheet; |
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.
- (void)presentCodeRedemptionSheet; | |
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos, macos, watchos); |
- (void)presentCodeRedemptionSheet { | ||
#if TARGET_OS_IOS | ||
if (@available(iOS 14.0, *)) { | ||
[self.paymentQueue presentCodeRedemptionSheet]; | ||
} else { | ||
// Fallback on earlier versions | ||
} | ||
#endif | ||
} |
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.
- (void)presentCodeRedemptionSheet { | |
#if TARGET_OS_IOS | |
if (@available(iOS 14.0, *)) { | |
[self.paymentQueue presentCodeRedemptionSheet]; | |
} else { | |
// Fallback on earlier versions | |
} | |
#endif | |
} | |
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos, macos, watchos) { | |
if (@available(iOS 14.0, *)) { | |
[self.paymentQueue presentCodeRedemptionSheet]; | |
} else { | |
RCLog(@"Tried presentCodeRedemptionSheet, but it's not supported on this device's OS version"); | |
} | |
} |
Purchases/Public/RCPurchases.m
Outdated
@@ -727,6 +727,11 @@ - (void)invalidatePurchaserInfoCache { | |||
[self.deviceCache clearPurchaserInfoCacheForAppUserID:self.appUserID]; | |||
} | |||
|
|||
- (void)presentCodeRedemptionSheet { |
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.
- (void)presentCodeRedemptionSheet { | |
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos, macos, watchos) { |
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.
we should add the api available bit here as well
@@ -66,6 +66,14 @@ - (void)finishTransaction:(SKPaymentTransaction *)transaction | |||
[self.paymentQueue finishTransaction:transaction]; | |||
} | |||
|
|||
- (void)presentCodeRedemptionSheet { |
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.
should add the api available bit here
Purchases/Public/RCPurchases.m
Outdated
@@ -727,6 +727,11 @@ - (void)invalidatePurchaserInfoCache { | |||
[self.deviceCache clearPurchaserInfoCacheForAppUserID:self.appUserID]; | |||
} | |||
|
|||
- (void)presentCodeRedemptionSheet { |
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.
we should add the api available bit here as well
@@ -66,6 +66,14 @@ - (void)finishTransaction:(SKPaymentTransaction *)transaction | |||
[self.paymentQueue finishTransaction:transaction]; | |||
} | |||
|
|||
- (void)presentCodeRedemptionSheet API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos, macos, watchos) { | |||
if (@available(iOS 14.0, *)) { | |||
[self.paymentQueue presentCodeRedemptionSheet]; |
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.
this gives an error
No visible @interface for 'SKPaymentQueue' declares the selector 'presentCodeRedemptionSheet'
on latest version 3.9.0.
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.
Which Xcode version are you running?
This method is only available when compiling on Xcode versions >= 12.0.
@alicanbatur Do you have any specific needs that force you to use earlier Xcode versions?
Adds this as part of the new Subscription offer codes https://developer.apple.com/app-store/subscriptions/#providing-subscription-offers