miyabi / react-native-passkit-wallet

React Native module to handle PassKit.
MIT License
52 stars 37 forks source link

_reactNativePasskitWallet2.default.canAddPasses is not a function #5

Closed copiousfreetime closed 6 years ago

copiousfreetime commented 6 years ago

Hi, We are attempting to use passkit-wallet on android and we are getting the following error when the following code is run on android

Original code:

  componentDidMount() {
    navigatorStyle = {
      navBarHidden: this.props.vip
    };

    PassKit.canAddPasses().then(result => {
      consloe.log("canAddPasses result: ", result);
      if (!result) {
        alert("Sorry, your device does not support adding passes.");
        _goHome();
      }
    }).catch(error => {
      console.log("canAddPass error: ", error);
    });

    // Add event listener
    PassKit.addEventListener(
      "addPassesViewControllerDidFinish",
      this.onAddPassesViewControllerDidFinish
    );
  }

Error showing up in adb logcat and also in the ReactNative redscreen:

05-17 12:30:13.796  5343 10283 I bugsnag-react-native: Sending exception: TypeError - TypeError: _reactNativePasskitWallet2.default.canAddPasses is not a function
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:
05-17 12:30:13.796  5343 10283 I bugsnag-react-native: This error is located at:
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in PassScreen (created by Connect(PassScreen))
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in Connect(PassScreen) (at Navigation.js:83)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in Provider (at Navigation.js:82)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in _class2 (at renderApplication.js:35)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in RCTView (at View.js:78)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in View (at AppContainer.js:102)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in RCTView (at View.js:78)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in View (at AppContainer.js:122)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native:     in AppContainer (at renderApplication.js:34)
05-17 12:30:13.796  5343 10283 I bugsnag-react-native: Notifying native client, severity = error, severityReason = unhandledException
05-17 12:30:13.796  5343 10283 I Bugsnag : Internal client notify, severity = 'error', severityReason = 'unhandledException'
05-17 12:30:13.807  5343 10283 I bugsnag-react-native: Notified native client
copiousfreetime commented 6 years ago

user error - someone had commented out new RNPassKitPackage() from our MainApplication.java file.