The purpose of this project is to demonstrate the integration of a React Native Android app with the Logion platform.
- Add
@logion/client-react-native-fs
andbuffer
dependencies (e.g.yarn add @logion/client-react-native-fs buffer
) - Setup
buffer
: addglobal.Buffer = Buffer;
toApp.tsx
- Setup
react-native-fs
: see instructions - Use the Logion SDK: see
App.tsx
(in particular,connect
andaddFile
callbacks)
Note: Make sure you have completed the React Native - Environment Setup instructions till "Creating a new application" step, before proceeding.
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.
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
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.
You can display the logs with
yarn react-native log-android