Open labadze opened 5 years ago
Having the same problem, in simulator works fine, but on real iOS device throws "Native module cannot be null."
pod 'react-native-passkit-wallet', :path => '../node_modules/react-native-passkit-wallet' in Pod file => pod install
Wrote native wallet implementation and implemented it.
Still having issues after linking it directly in the Pod file. Any other solution?
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?
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?
Hi @labadze , could you share how you got around this issue pls?
having the same problem with expo
news about this problems ?
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.