From c5349ba36d7b7562f01f5e9257c8c9ce21f7c164 Mon Sep 17 00:00:00 2001 From: polypixeldev <79737178+polypixeldev@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:35:36 -0500 Subject: [PATCH 1/2] add android instructions in readme --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0348cb..e59cc5f 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,50 @@ +## Setup + +HCB Mobile connects to HCB throught the v4 API. +You can either do this on the production HCB instance, or using a local development instance. + +### Production HCB + +Set your `.env` to include the following variables: + +``` +EXPO_PUBLIC_API_BASE=https://hcb.hackclub.com/api/v4 +EXPO_PUBLIC_CLIENT_ID=yt8JHmPDmmYYLUmoEiGtocYwg5fSOGCrcIY3G-vkMRs +EXPO_PUBLIC_STRIPE_API_KEY=pk_live_UAjIP1Kss29XZ6tW0MFWkjUQ +``` + +### Development HCB + +Go into the Rails console on your development server (`bin/rails c`), and run the following: + +``` +app = Doorkeeper::Application.create(name: "mobile", redirect_uri: "hcb://", scopes: ["read", "write"], confidential: false) +``` + +Then, set your `.env` to include the following variables: + +``` +EXPO_PUBLIC_API_BASE=http:///api/v4 +EXPO_PUBLIC_CLIENT_ID= +``` + ## Building on iOS 1. Install Xcode/Node.js 2. `npm install` 3. `npm run ios` - builds and runs the app in a simulator - - Run with the `--device` flag to get a device selector, e.g. to run on a physical iPhone + - Run with the `-- --device` flag to get a device selector, e.g. to run on a physical iPhone - Bonus task: fry an egg on your Mac while this runs + +## Building on Android + +1. Install Android Studio & Node.js +2. Setup a new AVD in Android Studio with api >= 34 +3. Install & set your `JAVA_HOME` to a Java 17 SDK +4. `npm install` +5. `npm run android` - builds and runs the app in a simulator + - Run with the `-- --device` flag to get a device selector, e.g. to run on a physical Android phone + - Bonus task: painfully watch Gradle attempt to work From 8a01a847e8fc95539205e1d949269f84140739bd Mon Sep 17 00:00:00 2001 From: polypixeldev <79737178+polypixeldev@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:39:15 -0500 Subject: [PATCH 2/2] grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e59cc5f..6bdda5e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ## Setup HCB Mobile connects to HCB throught the v4 API. -You can either do this on the production HCB instance, or using a local development instance. +You can either connect to the production HCB instance, or a local development instance. ### Production HCB