react-native-passkit-wallet icon indicating copy to clipboard operation
react-native-passkit-wallet copied to clipboard

“Native module cannot be null”

Open labadze opened this issue 7 years ago • 9 comments

Hello, I'm trying to implement PassKit wallet to my app. I'm using expo, so. where is no iOS Android folders, so I'm getting this error “Native module cannot be null”, This error is located in PassKit.ios.js on line 10. After this I detached app and implemented everything like in. manual but getting same error.

labadze avatar Sep 24 '18 09:09 labadze

Having the same problem, in simulator works fine, but on real iOS device throws "Native module cannot be null."

ikas avatar Oct 22 '18 14:10 ikas

pod 'react-native-passkit-wallet', :path => '../node_modules/react-native-passkit-wallet' in Pod file => pod install

VamshiKyra avatar Nov 21 '18 16:11 VamshiKyra

Wrote native wallet implementation and implemented it.

labadze avatar Mar 09 '19 19:03 labadze

Still having issues after linking it directly in the Pod file. Any other solution?

alvarosilvac avatar May 01 '19 19:05 alvarosilvac

I couldn't reproduce the error.

This is how I tested:

$ react-native init RNPW
$ cd RNPW
$ npm i --save react-native-passkit-wallet@git://github.com/miyabi/react-native-passkit-wallet.git
$ cd ios
$ pod init
# Follow this instruction: https://github.com/miyabi/react-native-passkit-wallet#cocoapods
# Remove RNPW-tvOSTests block from the target 'RNPW'
$ pod install

App.js would be like this:

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import PassKit, { AddPassButton } from 'react-native-passkit-wallet'

type Props = {};
export default class App extends Component<Props> {
  componentDidMount() {
    PassKit.canAddPasses()
      .then((result) => {
        console.log(result)
      });
  }

  render() {
    return (
      <View style={styles.container}>
        <AddPassButton
          style={styles.addPassButton}
          addPassButtonStyle={PassKit.AddPassButtonStyle.black}
          onPress={() => { console.log('onPress') }}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  addPassButton: {
    width: PassKit.AddPassButtonWidth,
    height: PassKit.AddPassButtonHeight,
  },
});

Could you provide more details?

miyabi avatar May 05 '19 06:05 miyabi

Hello all, I'm having the same error 'Native module cannot be null'. And I'm new to RN and I'm using Expo. Is there a way to use this package in an Expo app without ejecting?

liuxiaofeng1981 avatar Apr 04 '20 23:04 liuxiaofeng1981

Hi @labadze , could you share how you got around this issue pls?

liuxiaofeng1981 avatar Apr 05 '20 02:04 liuxiaofeng1981

having the same problem with expo

luluhoc avatar Nov 18 '22 17:11 luluhoc

news about this problems ?

ottosamatori avatar Dec 23 '23 00:12 ottosamatori