Installation
Install the React Native SDK and get building!
Install the SDK and React-Native wrapper via your preferred package manager
$ yarn add @node-fi/sdk-core @node-fi/react-native-sdk react-native-device-info react-native-keychain react-native-fast-crypto react-native-securerandom
or
$ npm install @node-fi/sdk-core @node-fi/react-native-sdk react-native-device-info react-native-keychain react-native-fast-crypto react-native-securerandom
Install pods
$ npx pod-install
or
$ cd ios
$ pod install
For FaceId to work for unlocking wallet credentials, permissions must be added in
info.plist
for the key NSFaceIDUsageDescription
, like so:info.plist
...
<key>NSFaceIDUsageDescription</key>
<string>Message here</string>
...
For Android development, you will need to make sure you have
NDK
and cMake
enabled in android studio. These are required to build react-native-fast-crypto
for android.Some specific configurations need to be set within the babel config. For this there are two options:
1 - Copy and paste the following as the base
babel.config.js
:babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: [
'babel-preset-expo',
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
// other presets here
],
plugins: [
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
['module:react-native-dotenv'],
// other settings here
],
// anything else
};
};.js
or 2 - Inject the required configurations via import:
babel.config.js
const nodeConfig = require('@node-fi/react-native-sdk/nodeWalletBabel');
module.exports = function (api) {
return { ...nodeConfig(api) };
};
Import
@node-fi/react-native-sdk/setup
within your initialization script.index.js
/* dapp-begin */
require('@node-fi/react-native-sdk/setup');
/**
* Other code goes here
*/
const { registerRootComponent } = require('expo');
const { default: App } = require('./frontend/App');
registerRootComponent(App);
/* dapp-end */
Last modified 2mo ago