-
-
Notifications
You must be signed in to change notification settings - Fork 202
Build Mobile App
To build BookCars mobile app, you need to have the following tools installed on your machine:
Install eas-cli with the following command:
npm i -g eas-cli
-
You need to download the google-services.json file and place it in ./mobile root directory for push notifications. Otherwise, the mobile app won't build.
-
If you don't have an Expo account, you'll need to create one to build BookCars mobile app.
-
Go to expo.dev, Click on Pojects then Create a Project. Set BookCars as project name and click on Create.
-
Go to BookCars project and copy the project ID. Open ./mobile/app.json and paste the project ID in extra.eas.projectId.
-
Go to ./mobile folder and run the following command to login to expo:
npx expo login
- Create an Expo Access Token from expo.dev (Account Settings > Access Tokens) and set api/.env BC_EXPO_ACCESS_TOKEN setting:
BC_EXPO_ACCESS_TOKEN=EXPO_ACCESS_TOKEN
- Create
mobile/.env
file with the following content:
BC_API_HOST=https://bookcars.com:4002
BC_DEFAULT_LANGUAGE=en
BC_PAGE_SIZE=20
BC_CARS_PAGE_SIZE=8
BC_BOOKINGS_PAGE_SIZE=8
BC_CDN_USERS=https://bookcars.com/cdn/bookcars/users
BC_CDN_CARS=https://bookcars.com/cdn/bookcars/cars
BC_COMAPANY_IMAGE_WIDTH=60
BC_COMAPANY_IMAGE_HEIGHT=30
BC_CAR_IMAGE_WIDTH=300
BC_CAR_IMAGE_HEIGHT=200
BC_APP_TYPE=frontend
BC_MINIMUM_AGE=21
Set the following options:
BC_API_HOST=https://bookcars.com:4002
BC_CDN_USERS=https://bookcars.com/cdn/bookcars/users
BC_CDN_CARS=https://bookcars.com/cdn/bookcars/cars
Replace https://bookcars.com
with an IP, hostname or FQDN.
If you want to use BookCars mobile app on production, you should use HTTPS in BookCars API and disable usesCleartextTraffic
expo plugin in ./mobile/app.json
by removing the line "./plugins/usesCleartextTraffic"
in plugins
section.
- Clone the source down to your machine:
git clone https://github.com/aelassas/bookcars.git
- Go to mobile folder:
cd ./mobile
- Run the following command
npm install
To build BookCars Android app with EAS Build hosted service, run the following command:
npm run build:android
macOS or Linux are required for local build. For Windows, you should use EAS Build.
You need to install Android SDK, JDK 11, and set ANDROID_HOME
and JAVA_HOME
environment variables. Then, run the following command:
npm run build:android:local
You need a paid Apple Developer account to build the iOS app for both EAS builds and local builds.
To build BookCars iOS app, run the following command:
npm run build:ios
You need to install fastlane and CocoaPods on macOS.
To build BookCars iOS app locally, run the following command:
npm run build:ios:local
Copyright © 2024 Akram El Assas. All rights reserved.