To run Textile Mobile in development mode you'll need,
- The latest code from this repo + dependencies
- The textile-go framework to run a cafe node
git clone [email protected]:textileio/textile-mobile.git
You can identify the correct cafe version you'll need by inspecting the /package.json
file to see the @textile/go-mobile
version number.
You can either clone/checkout the appropriate commit associated with that release or download the release built for your hardware. You can find the release here, textile-go releases
If you are running the Textile command line for the first time, use this Quick Start guide.
Now that you've started your daemon, modify it to run in Cafe mode and restart it. See here for instructions
At the same time, you can capture your API and Cafe addresses from the textile config file. They should look like,
"Addresses": {
"API": "127.0.0.1:40600",
"CafeAPI": "127.0.0.1:40601",
"Gateway": "127.0.0.1:5050"
},
You'll need these to modify your .env
to run the mobile app in development mode.
- Install all dependancies with
yarn
- Launch your Textile cafe (see above)
- Modify your
.env
file to match your cafe details (see below) - Finally, run
react-native start
and launch the app in the simulator of your choice. You can launch the app using one of hte IDEs or directly usingreact-native run-ios
orreact-native run-android
You should store a file called, .env
in the root of your Textile Mobile folder. It should look like,
RN_TEXTILE_CAFES_JSON="base64 encoded Cafe[] JSON"
RN_TEXTILE_GATEWAY_URL="http://{gateway-address}"
RN_TEXTILE_CAMERA_ROLL_THREAD_KEY="photos-camera_roll"
RN_TEMPORARY_REFERRAL="SOMETHING"
RN_URL_SCHEME="textile-dev"
RN_IOS_STORE_LINK="https://<ios store link>"
RN_ANDROID_STORE_LINK="https://<android store link>"
RN_TEXTILE_CAFES_JSON
should be the base64 encoded contents of a json file similar to:
[
{
"name": "A display name",
"peerId": "a-peer-id",
"token": "a-cafe-token"
},
{
"name": "Another display name",
"peerId": "another-peer-id",
"token": "another-cafe-token"
}
]
The gateway-address
(including port) and information to fill out the above json object should be found in the Cafe setup step above.