
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-native-wallet-pass
Advanced tools
React Native module to handle PassKit pass.
npmnpm install --save react-native-wallet-pass
You can link native code in the way you prefer:
Add line to your project target section in your Podfile:
target 'YourProjectTarget' do
+ pod 'react-native-wallet-pass', path: '../node_modules/react-native-wallet-pass'
end
If you received error jest-haste-map: Haste module naming collision: Duplicate module name: react-native, add lines below to your Podfile and reinstall pods.
target 'YourProjectTarget' do
+ rn_path = '../node_modules/react-native'
+ pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
+ pod 'React', path: rn_path
pod 'react-native-wallet-pass', path: '../node_modules/react-native-wallet-pass'
end
+ post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ if target.name == "React"
+ target.remove_from_project
+ end
+ end
+ end
Run command below:
react-native link react-native-wallet-pass
Add following lines to AndroidManifest.xml
<manifest ...>
<application ...>
...
+ <provider
+ android:name="android.support.v4.content.FileProvider"
+ android:authorities="com.yourcompany.fileprovider"
+ android:grantUriPermissions="true"
+ android:exported="false"
+ tools:replace="android:authorities">
+ <meta-data
+ android:name="android.support.FILE_PROVIDER_PATHS"
+ android:resource="@xml/passkit_file_paths"
+ tools:replace="android:resource" />
+ </provider>
</application>
</manifest>
Create passkit_file_paths.xml
Create passkit_file_paths.xml file in your project's android/src/main/res/xml directory.
pkpass file will be created in your app's cache directory.
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<cache-path name="passkit" path="/"/>
</paths>
import PassKit, { AddPassButton } from 'react-native-wallet-pass'
PassKit.canAddPasses()
.then((result) => {
console.log(result)
})
For Android, true will be returned if apps that can open pkpass files are installed.
PassKit.addPass(base64EncodedPass)
For Android, file provider has to be specified for the second argument. And a dialogue box will appear to choose an app to open the pass.
PassKit.addPass(base64EncodedPass, 'com.yourcompany.fileprovider')
class App extends Component<{}> {
render() {
return (
<AddPassButton
style={styles.addPassButton}
addPassButtonStyle={PassKit.AddPassButtonStyle.black}
onPress={() => { console.log('onPress') }}
/>
)
}
}
class App extends Component<{}> {
// To keep the context of 'this'
onAddPassesViewControllerDidFinish = this.onAddPassesViewControllerDidFinish.bind(this)
componentDidMount() {
// Add event listener
PassKit.addEventListener('addPassesViewControllerDidFinish', this.onAddPassesViewControllerDidFinish)
}
componentWillUnmount() {
// Remove event listener
PassKit.removeEventListener('addPassesViewControllerDidFinish', this.onAddPassesViewControllerDidFinish)
}
onAddPassesViewControllerDidFinish() {
// Add-passes view controller has been dismissed
console.log('onAddPassesViewControllerDidFinish')
}
}
FAQs
React Native module to handle PassKit pass.
We found that react-native-wallet-pass demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.