react-native-purchases
react-native-purchases copied to clipboard
'presentCodeRedemptionSheet()' is unavailable in Mac Catalyst
Describe the bug I have a React Native app running on iOS and macOS (via Catalyst) I have successfully installed the React Native SDK, and on iOS it works fine. But when running on macOS I receive a compile error:
'presentCodeRedemptionSheet()' is unavailable in Mac Catalyst
From the doc I understood Catalyst was supported within the iOS SDK. Is the React Native SDK for iOS different?
- Environment
- Platform: React Native (on Catalyst)
- SDK version: 4.6.1
- OS version: 12.4
- Xcode/Android Studio version: 13.4.1
- React Native version: 0.64.2
- SDK installation (CocoaPods + version or manual): CocoaPods
π SDKONCALL-95 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
~Oh, looks like we got our availability wrong on this π€¦ββοΈ making updates now.~
I'm wrong, reading our notes-
// Even though the docs in `SKPaymentQueue.presentCodeRedemptionSheet`
// say that it's available on Catalyst 14.0, there is a note:
// This function doesnβt affect Mac apps built with Mac Catalyst.
// It crashes when called both from Catalyst and also when running as "Designed for iPad".
from https://github.com/RevenueCat/purchases-ios/blob/3a4093d2286a483a163ef5311ec813220f6a9445/Sources/Purchasing/StoreKit1/StoreKitWrapper.swift#L95
I was digging into this, but would it be possible to check if it's on catalyst and skip it?
As I'm reading what this method does, I don't think it's vital, I could very much live without it π at least the code would compile.
With the following changes, it compiles. I haven't tested yet if everything works, I've just started with RevenueCat (and I really like it).
Do you see adding these as feasible? Do you want me to open a PR? Would you handle it directly?
We just released a new 5.0.0 beta, give that a shot π
Here's the change that we did: https://github.com/RevenueCat/purchases-hybrid-common/pull/197/files
Tried the 5.0.0 but still an issue
Fixed: #425