Giter Site home page Giter Site logo

Comments (17)

wengqianshan avatar wengqianshan commented on June 12, 2024 1

@vegaro
It works fine, thank you so much!
image

from react-native-purchases.

GiomScript avatar GiomScript commented on June 12, 2024

I have the same exact problem with this import - import Purchases from "react-native-purchases";

from react-native-purchases.

mshmoustafa avatar mshmoustafa commented on June 12, 2024

Hey all,
I've pinged the mobile engineering team for assistance, I'll update this issue with their input.

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

Can you please share your dependencies in your package.json so we can try to replicate? Thanks!

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024

@vegaro
ok, just like this

{
  "name": "wktv",
  "version": "2.0.0",
  "dependencies": {
    "expo": "^50.0.11",
    "expo-splash-screen": "~0.26.4",
    "expo-status-bar": "~1.11.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "npm:react-native-tvos@^0.73.6-0",
    "react-native-purchases": "^7.24.0"
  },
  "devDependencies": {
    "@babel/core": "~7.20.0",
    "@react-native-tvos/config-tv": "^0.0.7",
    "@types/react": "~18.2.45",
    "typescript": "^5.3.0"
  },
  "expo": {
    "install": {
      "exclude": [
        "react-native"
      ]
    }
  },
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  }
}

you can follow this step to create a test project: https://github.com/expo/examples/tree/master/with-tv

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024
image

By comparing the .podspec file, I found that the react-native-iap module s.platforms contains tvos, but react-native-purchases does not. (react-native-iap worked fine for expo tvOS project)

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

I've been trying to work this out but I am struggling with Expo, I am able to install the dependency if using this branch I just created that adds the tvos platform and changes the react native dependencies to *

    "react-native-purchases": "RevenueCat/react-native-purchases#tvos"
  "peerDependencies": {
    "react": "*",
    "react-native": "*"
  },

Do you mind giving that a try? If that branch works, we can make a release with the fix.

Thank you!

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024

@vegaro
Thank you very much. I can install the module after trying it, but I get an error when using it:

ERROR  Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes

After pod install, I still can’t find the native module related to react-native-purchases in the ios/Podfile.lock file

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

Yes, I can reproduce... You're also getting the npm error when installing react-native-iap right? So you have to force install it, correct? But then it is correctly linking the pod

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024

@vegaro yes that's it😄

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024

Later I tried to modify react-native-purchases :

spec.platforms = { :ios => "10.0" , :tvos => "10.0"}

The pod was magically installed, but the following error occurred

截屏2024-03-22 00 57 41

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

Oh that's interesting. You modified it in the node modules folder? I was doing that this morning but it wasn't installing either. Looks like you dropped the platform to 10 though?

from react-native-purchases.

wengqianshan avatar wengqianshan commented on June 12, 2024

@vegaro
Yes, I modified it in node_modules with the help of patch-package.

It doesn't work for you may be you are using a platform instead of platforms.

I've tried both platform versions 10 and 11, and it doesn't seem to have any effect.

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

you were right @wengqianshan , I was doing platform instead of platforms...

I pushed again to that tvos branch some conditional checks that prevent the compilation issues. It looks like the SDK is getting configured when I run it.

Can you test it works on your end? If it does, we can maybe throw a release next week adding support for this.

Thanks!

from react-native-purchases.

vegaro avatar vegaro commented on June 12, 2024

Amazing, I will try to get that merged soon 😄

from react-native-purchases.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.