chirag04 / react-native-in-app-utils

A react-native wrapper for handling in-app payments
MIT License
890 stars 185 forks source link

react-native-in-app-utils not added to NativeModules #177

Open cpcrowley opened 6 years ago

cpcrowley commented 6 years ago

I am upgrading my app from 0.48 to 0.55 by reconstructing a new app. I ran:"react-native install react-native-in-app-utils" and it completed successfully. See terminal output below.

I have in my app: import { NativeModules } from 'react-native'; const { InAppUtils } = NativeModules;

When I run it InAppUtils is undefined and NativeModules is empty. It was working on the 048 version. Is there something else I need to do to get it to work in 0.55?

riMac: react-native install react-native-in-app-utils Scanning folders for symlinks in /Users/cpcrowley/a/slp/st55/node_modules (26ms) yarn add v0.19.1 [1/4] πŸ” Resolving packages... [2/4] 🚚 Fetching packages... [3/4] πŸ”— Linking dependencies... warning "react-native@0.55.4" has incorrect peer dependency "react@16.3.1". warning "react-native-fs@2.10.14" has incorrect peer dependency "react-native@^0.51.0". warning "react-native-fs@2.10.14" has incorrect peer dependency "prop-types@15.6.0". [4/4] πŸ“ƒ Building fresh packages... success Saved lockfile. success Saved 114 new dependencies. β”œβ”€ acorn-jsx@3.0.1 β”œβ”€ acorn@5.6.2 β”œβ”€ ajv-keywords@2.1.1 β”œβ”€ ajv@5.5.2 β”œβ”€ array-includes@3.0.3 β”œβ”€ array-union@1.0.2 β”œβ”€ array-uniq@1.0.3 β”œβ”€ arrify@1.0.1 β”œβ”€ babel-code-frame@6.26.0 β”œβ”€ base-64@0.1.0 β”œβ”€ caller-path@0.1.0 β”œβ”€ callsites@0.2.0 β”œβ”€ circular-json@0.3.3 β”œβ”€ cli@1.0.1 β”œβ”€ color-convert@1.9.1 β”œβ”€ color-name@1.1.3 β”œβ”€ color-string@1.5.2 β”œβ”€ color@2.0.1 β”œβ”€ console-browserify@1.1.0 β”œβ”€ contains-path@0.1.0 β”œβ”€ date-now@0.1.4 β”œβ”€ del@2.2.2 β”œβ”€ doctrine@1.5.0 β”œβ”€ dom-serializer@0.1.0 β”œβ”€ domelementtype@1.3.0 β”œβ”€ domhandler@2.3.0 β”œβ”€ domutils@1.5.1 β”œβ”€ entities@1.0.0 β”œβ”€ es-abstract@1.11.0 β”œβ”€ eslint-config-standard@11.0.0 β”œβ”€ eslint-import-resolver-node@0.3.2 β”œβ”€ eslint-module-utils@2.2.0 β”œβ”€ eslint-plugin-import@2.12.0 β”œβ”€ eslint-plugin-node@6.0.1 β”œβ”€ eslint-plugin-promise@3.8.0 β”œβ”€ eslint-plugin-react@7.9.1 β”œβ”€ eslint-plugin-standard@3.1.0 β”œβ”€ eslint-scope@3.7.1 β”œβ”€ eslint-visitor-keys@1.0.0 β”œβ”€ eslint@4.19.1 β”œβ”€ espree@3.5.4 β”œβ”€ esquery@1.0.1 β”œβ”€ esrecurse@4.2.1 β”œβ”€ estraverse@4.2.0 β”œβ”€ exit@0.1.2 β”œβ”€ expect@23.1.0 β”œβ”€ file-entry-cache@2.0.0 β”œβ”€ flat-cache@1.3.0 β”œβ”€ functional-red-black-tree@1.0.1 β”œβ”€ globals@11.5.0 β”œβ”€ globby@5.0.0 β”œβ”€ htmlparser2@3.8.3 β”œβ”€ ignore@3.3.8 β”œβ”€ inherits@2.0.3 β”œβ”€ is-arrayish@0.3.1 β”œβ”€ is-path-cwd@1.0.0 β”œβ”€ is-path-in-cwd@1.0.1 β”œβ”€ is-path-inside@1.0.1 β”œβ”€ is-resolvable@1.1.0 β”œβ”€ isarray@1.0.0 β”œβ”€ jest-cli@23.1.0 β”œβ”€ jest-config@23.1.0 β”œβ”€ jest-each@23.1.0 β”œβ”€ jest-environment-jsdom@23.1.0 β”œβ”€ jest-environment-node@23.1.0 β”œβ”€ jest-jasmine2@23.1.0 β”œβ”€ jest-message-util@23.1.0 β”œβ”€ jest-mock@23.1.0 β”œβ”€ jest-resolve@23.1.0 β”œβ”€ jest-runner@23.1.0 β”œβ”€ jest-runtime@23.1.0 β”œβ”€ jest-util@23.1.0 β”œβ”€ jest-watcher@23.1.0 β”œβ”€ jest@23.1.0 β”œβ”€ js-yaml@3.12.0 β”œβ”€ jshint@2.9.5 β”œβ”€ json-stable-stringify-without-jsonify@1.0.1 β”œβ”€ jsx-ast-utils@2.0.1 β”œβ”€ keymirror@0.1.1 β”œβ”€ levn@0.3.0 β”œβ”€ lodash@3.7.0 β”œβ”€ minimatch@3.0.4 β”œβ”€ optionator@0.8.2 β”œβ”€ path-is-inside@1.0.2 β”œβ”€ pkg-dir@1.0.0 β”œβ”€ pluralize@7.0.0 β”œβ”€ progress@2.0.0 β”œβ”€ prop-types@15.6.1 β”œβ”€ react-is@16.4.0 β”œβ”€ react-native-camera@1.1.4 β”œβ”€ react-native-fs@2.10.14 β”œβ”€ react-native-in-app-utils@6.0.0 β”œβ”€ react-native-sound-player@0.3.0 β”œβ”€ react-native-svg@6.3.1 β”œβ”€ react-native-vector-icons@4.6.0 β”œβ”€ react-native-video@2.2.0 β”œβ”€ react-test-renderer@16.4.0 β”œβ”€ react@16.4.0 β”œβ”€ readable-stream@1.1.13 β”œβ”€ regexpp@1.1.0 β”œβ”€ require-uncached@1.0.3 β”œβ”€ resolve-from@1.0.1 β”œβ”€ resolve@1.7.1 β”œβ”€ rimraf@2.6.2 β”œβ”€ shelljs@0.3.0 β”œβ”€ simple-swizzle@0.2.2 β”œβ”€ slice-ansi@1.0.0 β”œβ”€ string_decoder@0.10.31 β”œβ”€ strip-json-comments@1.0.4 β”œβ”€ table@4.0.2 β”œβ”€ text-table@0.2.0 β”œβ”€ utf8@2.1.2 β”œβ”€ write@0.2.1 └─ yargs@8.0.2 ✨ Done in 61.27s. Scanning folders for symlinks in /Users/cpcrowley/a/slp/st55/node_modules (12ms) rnpm-install info Linking react-native-in-app-utils ios dependency rnpm-install info Platform 'ios' module react-native-in-app-utils has been successfully linked rnpm-install info Module react-native-in-app-utils has been successfully installed & linked

ZainaliSyed commented 6 years ago

same Issue . I have install lib using YARN and link as well but getting undefined "react-native-in-app-utils": "^6.0.0", "react-native": "0.55.0", "react": "^16.3.0-alpha.1", @chirag04

itchii-06 commented 6 years ago

I have same issue. I use RN 0.54.0. I solved by manual-linking. https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking

chirag04 commented 6 years ago

I would recommend manual linking. Happy to accept a PR that fixes linking via rnmp

ZainaliSyed commented 6 years ago

I have found Solution
Reference Stack overflow answer Install Library (react-native-in-app-utils) using rnpm. you need to install rnpm.

  1. npm install rnpm -g
  2. rnpm install react-native-in-app-utils

rnpm will auto link your library for IOS.

13arturbruno commented 5 years ago

just run : 1- react-native install react-native-in-app-utils 2- react-native link react-native-in-app-utils (if dont linked automatically) 3- in ios/ run 'pod install'

work to me πŸ‘