This entry is a cross-platform mobile app using NativeScript. It defines a login flow that allows a user to setup an urbit connection and then access an existing agent on that urbit.
As shown below, when first run, the app allows the user to progress through each step and validates that the entered information is correct along the way.
After the user has successfully connected to an Urbit, the app will then query the Urbit to get the user's entered weights for display.
- Due to an issue with the Android Server Sent Events library, I was unable to use
channel.js
to connect anEventSource
to the Urbit. (The library uses aGET
request to initiate theEventSource
and Urbit requires aPUT
) - I also could not figure out how to set the state during an http request, so the mobile app is readonly for now.
After cloning the repository, you will need to do the following
- Run
npm install
- Create an
.urbitrc
file in the root directory of the project with the path to your pier
module.exports = {
URBIT_PIERS: [
"<full path to your pier>",
]
};
- (optional) - Setup the android emulator by following the instructions here
After completing the setup, you're ready to install the Urbit weight-app
agent. You can do so using the following steps
- Run
npm run sync
from the root of the repository - In the Urbit dojo run
|commit %home
|start %weight-app
Once installed, you can add some weights to the agent using the following command in the Urbit dojo
:weight-app &weight-app-action [%add-weight 180]
There are a few ways to install the mobile app on android
- Run locally with emulator:
npx tns run android
- You can also install the
.apk
located in the releases