Skip to content

logion-network/ReactNativePoc

Repository files navigation

React Native POC

The purpose of this project is to demonstrate the integration of a React Native Android app with the Logion platform.

Setting up Logion in a new React Native project

  1. Add @logion/client-react-native-fs and buffer dependencies (e.g. yarn add @logion/client-react-native-fs buffer)
  2. Setup buffer: add global.Buffer = Buffer; to App.tsx
  3. Setup react-native-fs: see instructions
  4. Use the Logion SDK: see App.tsx (in particular, connect and addFile callbacks)

Getting Started

Note: Make sure you have completed the React Native - Environment Setup instructions till "Creating a new application" step, before proceeding.

Step 0: configure your access to Logion

If not done yet, copy config.ts.sample to config.ts and change the variables to match your setup.

Never commit config.ts (it is gitignored) as it contains the seed of an account.

Step 1: Start the Metro Server

First, you will need to start Metro, the JavaScript bundler that ships with React Native.

To start Metro, run the following command from the root of your React Native project:

# using npm
npm start

# OR using Yarn
yarn start

Step 2: Start your Application

Let Metro Bundler run in its own terminal. Open a new terminal from the root of your React Native project. Run the following command to start your Android app:

# using npm
npm run android

# OR using Yarn
yarn android

If everything is set up correctly, you should see your new app running in your Android Emulator shortly provided you have set up your emulator/simulator correctly.

This is one way to run your app — you can also run it directly from within Android Studio.

Debugging

You can display the logs with

yarn react-native log-android

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published