@pagopa/io-react-native-iso18013
v0.9.1
Published
React Native bridge for iso18013 methods
Readme
@pagopa/io-react-native-iso18013
This library provides a React Native module which allows proximity presentation according to the ISO 18013-5 standard, remote presentation according to the ISO 18013-7 standard, decoding of CBOR data and management of COSE verify and sign operations.
Installation
npm install @pagopa/io-react-native-iso18013Usage
This library includes two native modules for both iOS and Android:
- IoReactNativeIso18013 for ISO 18013-5 and ISO 18013-7 implementations;
- IoReactNativeCbor for CBOR and COSE implementations.
On the javascript side, the library exposes the following modules:
- ISO18013-5: Proximity presentation according to the ISO 18013-5 standard which is part of the
IoReactNativeIso18013module; - ISO18013-7: Remote presentation according to the ISO 18013-7 standard which is part of the
IoReactNativeIso18013module; - CBOR: Decoding of CBOR data into readable objects which is part of the
IoReactNativeCbormodule; - COSE: Management of COSE verify and sign operations which is part of the
IoReactNativeCbormodule.
Tests
JavaScript
yarn testAndroid
cd example/android
./gradlew :pagopa_io-react-native-iso18013:testDebugUnitTestAlternatively, run ./gradlew test to run the unit tests of every project, including the example app.
iOS
The iOS unit tests are located in ios/Tests and cover the IOWalletCBOR and IOWalletProximity libraries. They are exposed as the Tests test spec of the podspec, which is enabled in the example app Podfile and generates the IoReactNativeIso18013-Unit-Tests scheme.
Install the pods first:
cd example/ios
pod installThen run the tests from Xcode by opening example/ios/IoReactNativeIso18013Example.xcworkspace, selecting the IoReactNativeIso18013-Unit-Tests scheme and an iOS simulator, and pressing ⌘U.
Alternatively, run them from the command line:
cd example/ios
xcodebuild test \
-workspace IoReactNativeIso18013Example.xcworkspace \
-scheme IoReactNativeIso18013-Unit-Tests \
-destination 'platform=iOS Simulator,name=iPhone 16'To run a single test, add -only-testing:IoReactNativeIso18013-Unit-Tests/<TestClass>/<testMethod>.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
