react-native-card-io
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -1,5 +0,5 @@ | ||
let React = require('react-native'); | ||
let { NativeModules } = React; | ||
let { CardIOUtilities } = NativeModules; | ||
import { NativeModules } from 'react-native'; | ||
module.exports = CardIOUtilities; | ||
const { CardIOUtilities } = NativeModules; | ||
export default CardIOUtilities; |
@@ -1,58 +0,56 @@ | ||
let React = require('react-native'); | ||
let { requireNativeComponent, NativeAppEventEmitter } = React; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { requireNativeComponent, NativeAppEventEmitter } from 'react-native'; | ||
let CardIOView = React.createClass({ | ||
displayName: 'CardIOView', | ||
propTypes: { | ||
languageOrLocale: React.PropTypes.oneOf([ | ||
'ar','da','de','en','en_AU','en_GB','es','es_MX','fr','he','is','it','ja','ko','ms', | ||
'nb','nl','pl','pt','pt_BR','ru','sv','th','tr','zh-Hans','zh-Hant','zh-Hant_TW', | ||
]), | ||
guideColor: React.PropTypes.string, | ||
useCardIOLogo: React.PropTypes.bool, | ||
hideCardIOLogo: React.PropTypes.bool, | ||
allowFreelyRotatingCardGuide: React.PropTypes.bool, | ||
scanInstructions: React.PropTypes.string, | ||
scanOverlayView: React.PropTypes.element, | ||
scanExpiry: React.PropTypes.bool, | ||
scannedImageDuration: React.PropTypes.number, | ||
detectionMode: React.PropTypes.oneOf([ | ||
'cardImageAndNumber', | ||
'cardImageOnly', | ||
'automatic', | ||
]), | ||
didScanCard: React.PropTypes.func, | ||
hidden: React.PropTypes.bool, | ||
}, | ||
statics: { | ||
class CardIOView extends Component { | ||
displayName = 'CardIOView'; | ||
statics = { | ||
cardImageAndNumber: 'cardImageAndNumber', | ||
cardImageOnly: 'cardImageOnly', | ||
automatic: 'automatic', | ||
}, | ||
}; | ||
getDefaultProps() { | ||
return { | ||
didScanCard: () => {}, | ||
}; | ||
}, | ||
defaultProps = { | ||
didScanCard: () => {}, | ||
}; | ||
componentWillMount() { | ||
_listener = NativeAppEventEmitter.addListener('didScanCard', this.props.didScanCard); | ||
}, | ||
this._listener = NativeAppEventEmitter.addListener('didScanCard', this.props.didScanCard); | ||
} | ||
componentWillUnmount() { | ||
if (_listener) _listener.remove(); | ||
}, | ||
if (this._listener) this._listener.remove(); | ||
} | ||
render() { | ||
return <RCTCardIOView {...this.props} />; | ||
}, | ||
} | ||
_listener: null, | ||
}); | ||
_listener = null; | ||
} | ||
let RCTCardIOView = requireNativeComponent('RCTCardIOView', CardIOView); | ||
CardIOView.propTypes = { | ||
languageOrLocale: PropTypes.oneOf([ | ||
'ar','da','de','en','en_AU','en_GB','es','es_MX','fr','he','is','it','ja','ko','ms', | ||
'nb','nl','pl','pt','pt_BR','ru','sv','th','tr','zh-Hans','zh-Hant','zh-Hant_TW', | ||
]), | ||
guideColor: PropTypes.string, | ||
useCardIOLogo: PropTypes.bool, | ||
hideCardIOLogo: PropTypes.bool, | ||
allowFreelyRotatingCardGuide: PropTypes.bool, | ||
scanInstructions: PropTypes.string, | ||
scanOverlayView: PropTypes.element, | ||
scanExpiry: PropTypes.bool, | ||
scannedImageDuration: PropTypes.number, | ||
detectionMode: PropTypes.oneOf([ | ||
'cardImageAndNumber', | ||
'cardImageOnly', | ||
'automatic', | ||
]), | ||
didScanCard: PropTypes.func, | ||
hidden: PropTypes.bool, | ||
}; | ||
module.exports = CardIOView; | ||
const RCTCardIOView = requireNativeComponent('RCTCardIOView', CardIOView); | ||
export default CardIOView; |
@@ -1,6 +0,4 @@ | ||
let CardIO = { | ||
CardIOView: require('./card_io_view'), | ||
CardIOUtilities: require('./card_io_utilities'), | ||
} | ||
import CardIOView from './card_io_view'; | ||
import CardIOUtilities from './card_io_utilities'; | ||
module.exports = CardIO; | ||
export { CardIOView, CardIOUtilities }; |
{ | ||
"name": "react-native-card-io", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "React Native component for card.io", | ||
@@ -10,2 +10,5 @@ "repository": { | ||
"main": "index.js", | ||
"scripts": { | ||
"postinstall": "unzip ios/libs/card.io-iOS-SDK/CardIO/libCardIO.a.zip -d ios/libs/card.io-iOS-SDK/CardIO/" | ||
}, | ||
"keywords": [ | ||
@@ -12,0 +15,0 @@ "react-component", |
@@ -9,8 +9,7 @@ # card.io component for React Native | ||
1. Run `npm install react-native-card-io --save` in your project directory | ||
1. Inside `node_modules`, unzip `react-native-card-io/ios/libs/card.io-iOS-SDK/CardIO/libCardIO.a.zip` | ||
1. Open your project in XCode, right click on `Libraries` and click `Add Files to "Your Project Name"` | ||
1. Within `node_modules`, find `react-native-card-io/ios` and add RCTCardIO.xcodeproj to your project. | ||
1. Add `libRTCCardIO.a` to `Build Phases -> Link Binary With Libraries` | ||
1. Add the `-lc++` flag to `Build Settings -> Other Linker Flags` | ||
1. Run `npm install react-native-card-io --save` in your project directory. | ||
1. Open your project in XCode (make sure to open `.xcworkspace` NOT `.xcproject`), right click on `Libraries` and click `Add Files to "Your Project Name"`. | ||
1. Within `node_modules`, find `react-native-card-io/ios` and add `RCTCardIO.xcodeproj` to your project. | ||
1. Add `libRCTCardIO.a` to `Build Phases -> Link Binary With Libraries`. | ||
1. Add the `-lc++` flag to `Build Settings -> Other Linker Flags`. | ||
@@ -24,4 +23,3 @@ ## Installation Android | ||
``` javascript | ||
let CardIO = require('react-native-card-io'); | ||
let { CardIOUtilities, CardIOView } = CardIO; | ||
import {CardIOView, CardIOUtilities} from 'react-native-card-io' | ||
@@ -45,8 +43,7 @@ ... | ||
languageOrLocale="en_AU" | ||
guideColor="red" | ||
guideColor="#FF0000" | ||
useCardIOLogo={true} | ||
hideCardIOLogo={false} | ||
allowFreelyRotatingCardGuide={true} | ||
scanInstructions={''} | ||
scanOverlayView={<View />} | ||
scanInstructions={'Hold card here. It will scan automatically.'} | ||
scanExpiry={true} | ||
@@ -113,2 +110,2 @@ scannedImageDuration={2} | ||
card.io does not store or transmit credit card numbers. | ||
Recommend using the [Privacy Snapshot react-native component](https://github.com/kayla-tech/react-native-privacy-snapshot) if using with iOS to blur the screen when the app is backgrounded. | ||
Recommend using the [Privacy Snapshot react-native component](https://github.com/kayla-tech/react-native-privacy-snapshot) if using with iOS to blur the screen when the app is backgrounded. |
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
107265744
192
108
1