This project is meant to be used as a template for building a mobile app wrapper for urbit apps.
The template is based on Expo.
- Install Expo with
npm install -g expo-cli
. - Install dependencies with
expo install
.
In order for this app to work correctly, you must update the following:
- The constants
APP_ROUTE
andAPP_TITLE
in/src/constants/App.ts
should match the name of your app route ("landscape") and app name ("Groups") respectively. - The regular expressions
TARGET_APP_URL_REGEX
andDISTRO_SHIP
in/src/constants/Webview.ts
should match the name of your app route and distro ship respectively. - Update the image files in
/assets
. - Update
package.json
andapp.json
with your app name,package
(Android), andbundleIdentifier
(iOS). You will specify thepackage
andbundleIdentifier
when setting up your app in the Google Play Store and the iOS App Store.
The easiet way to do development is to run expo start
, install the Expo Go app on your phone, and then follow the instructions to download and run the dev version of your app. The app should have hot reloading by default.
Follow the Expo Distribution Guide.
- The Login screen which authenticates with an urbit instance
- The Webview in which the urbit web app is rendered
- The Header which allows navigation to Grid
- The Ships screen which allows for logging in with multiple ships
- Auto-prompt user to install the urbit app if it is not installed
- Push notification support
Sending and using push notifications requires some additional work on the urbit side. See https://github.com/uqbar-dao/urbit/blob/escape/pkg/escape/app/push-notify.hoon for an example.
Specifically:
- The push notification token must be stored on the urbit ship (using in
settings-store
). Your urbit app's web UI must expose an API object attached to the window. - The push notification must be sent with a
data
payload with a way to navigate the user to the correct page in the web app. Usually this means aredirect
and aship
value as shown here. - There must be a handler in the mobile app to handle the user tapping on the notification (already included in this template).
- You must follow the guide to set up push notifications with Google's Firebase Cloud Messaging (FCM) and Apple Push Notification Services (APNS).
The author of this repo went through a little back-and-forth with App Store review when initially publishing. At first they said that it looked like an internal app so the App Store wasn't the right place. I had to put in a logo in order to get around that. I supplied a moon's URL and the +code to log in for testing purposes, but they said that it was weird that I was supplying a URL to log in and was I sure that the App Store is the right place for this? I then replied and said that all prospective users had their own servers, the potential user base was both large and sophisticated, and that all of this was a big part of the app experience which the target users would understand.
Post any questions in the Uqbar urbit group in the help channel.