react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

'presentCodeRedemptionSheet()' is unavailable in Mac Catalyst

Open tommycarpi opened this issue 2 years ago β€’ 6 comments

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

Screenshot 2022-08-12 at 18 56 56

From the doc I understood Catalyst was supported within the iOS SDK. Is the React Native SDK for iOS different?

  1. Environment
    1. Platform: React Native (on Catalyst)
    2. SDK version: 4.6.1
    3. OS version: 12.4
    4. Xcode/Android Studio version: 13.4.1
    5. React Native version: 0.64.2
    6. SDK installation (CocoaPods + version or manual): CocoaPods

tommycarpi avatar Aug 12 '22 17:08 tommycarpi

πŸ‘€ 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!

RCGitBot avatar Aug 12 '22 17:08 RCGitBot

~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

taquitos avatar Aug 12 '22 17:08 taquitos

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.

tommycarpi avatar Aug 12 '22 21:08 tommycarpi

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).

Screenshot 2022-08-13 at 00 19 09 Screenshot 2022-08-13 at 00 20 06

Do you see adding these as feasible? Do you want me to open a PR? Would you handle it directly?

tommycarpi avatar Aug 12 '22 22:08 tommycarpi

We just released a new 5.0.0 beta, give that a shot πŸ˜„

taquitos avatar Aug 15 '22 17:08 taquitos

Here's the change that we did: https://github.com/RevenueCat/purchases-hybrid-common/pull/197/files

taquitos avatar Aug 15 '22 17:08 taquitos

Tried the 5.0.0 but still an issue

Screenshot 2022-08-28 at 12 20 47

tommycarpi avatar Aug 28 '22 10:08 tommycarpi

Fixed: #425

NachoSoto avatar Aug 29 '22 00:08 NachoSoto