republik / app

The app: a thin wrapper for persistent auth, app store presence, notification, background audio and convenience.
https://www.republik.ch/app
Other
11 stars 2 forks source link
react react-native

Republik App

A thin native app for persistent auth, app store presence and convenience.

Most views are provided by republik-frontend and rendered in a web view.

License

The logo (republik_logo.png) is property of its owner (Project R), and may not be reproduced without permission.

The source code is «BSD 3-clause» licensed.

General Setup

Setup React Native for projects with native code.

Env

Bootstrap your .env files:

cp .env.example .env.development
cp .env.example .env.staging
cp .env.example .env.production

If FRONTEND_BASE_URL is changed you have to clear the babel loader cache:

rm -rf node_modules/.cache/babel-loader/*

Environment Setup

The app is configured to be built on a Mac with Apple Silicon running MacOS Ventura.

For React Native dependencies see: Setting up the development environment

Tested software versions for building the app (the latest iOS build was created on 08.09.23 using these versions):

To build the current app via Terminal, the Terminal needs to run in Rosetta 2 (right click on the Terminal app in Finder and under "Get Info" select Rosetta 2).

Other Xcode, Node or macOS versions might cause build issues.

Additional Setup

Install

yarn
cd ios
pod install

Run Dev

With Local Frontend and Production API

Runs the app in a simulator and use localhost build of republik-frontend with yaproxy for api.

in republik-frontend:

npm run dev
npm run yaproxy

in app:

yarn run ios
yarn run android

Optionally specify simulator: yarn run ios --simulator iPhone 11

Run with Staging Frontend

Set a remote FRONTEND_BASE_URL in .env.staging and the run:

yarn run ios-staging
yarn run android-staging

Universal Links

The app is configured to responde to www.republik.ch links.

You can test this in the iOS simulator by running following command:

xcrun simctl openurl booted "https://www.republik.ch/feed"

Testing with Android virtual devices:

adb shell am start -a android.intent.action.VIEW \
    -c android.intent.category.BROWSABLE \
    -d "https://www.republik.ch/feed"

Notifications

On iOS you can drag the notification.apns and notification-authorization.apns file onto the simulator for testing.