This project aims to bring IPFS support in Mobile Apps (Via React Native as F.E) with the help of https://github.com/ipfs-shipyard/gomobile-ipfs library which is written in Golang.
Note: Make sure you have completed the React Native - Environment Setup instructions till "Creating a new application" step, before proceeding.
You need
- Golang 1.18 installed
- Java 17 or higher installed.
- For Android, Make sure NDK version 23.1.7779620 is installed.
- Add below configurations to your
.zshrc
or.bashrc
file
macOS
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/23.1.7779620"
export PATH="$PATH:$ANDROID_HOME/emulator"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
Run the below commands for the first time
npm install
cd go
go mod download
cd bind/core
go run golang.org/x/mobile/cmd/gomobile init
Also start the RN Metro server by running `npm run start` in a seperate terminal
Now, to run the Android App,
./installAndroid.sh
Now, to run the iOS App,
./buildiOS.sh
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 or iOS app:
# using npm
npm run android
# OR using Yarn
yarn android
# using npm
npm run ios
# OR using Yarn
yarn ios