Files
Ontime/test/README.md
2026-03-11 15:29:37 +07:00

58 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ontime Merchant (id.ontime.merchant)
Small Android app: Firebase Auth (phone OTP and email/password), FCM, and request/response logging.
## Setup
1. **Open in Android Studio** (or ensure JDK 17+ and Android SDK are installed).
2. **Firebase Console** (project `ngojol-trial`):
- Enable **Authentication → Sign-in method → Email/Password** (for email login).
- Enable **Authentication → Sign-in method → Phone** (for phone OTP login). Add your apps SHA-1 in Project settings if you use phone auth (e.g. from `keytool -list -v -keystore app/ontimekeystore.jks`).
3. **Realtime Database** (required for Send message): This app uses the same Firebase project as other apps. **Add** only the `merchant_messages` rules; do **not** replace your existing rules.
- In Firebase Console → **Realtime Database****Rules**, open your current rules.
- Inside the `"rules"` object, add the block below (keep any existing keys like `customer_messages`, `driver_messages`, etc.):
```json
"merchant_messages": {
"$uid": {
".read": "auth != null",
".write": "auth != null"
}
}
```
- Example merged rules (yours may differ):
```json
{
"rules": {
"customer_messages": { ... },
"driver_messages": { ... },
"merchant_messages": {
"$uid": {
".read": "auth != null",
".write": "auth != null"
}
}
}
}
```
Then click **Publish**. See `database.rules.merge-only.txt` for the fragment only.
4. Build and run: **Run → Run 'app'** or `./gradlew assembleDebug` (with Java and Android SDK on PATH).
## Credentials
- **Phone:** 62811936767 (for OTP: use with country code, e.g. +62811936767; for email login: `62811936767@merchant.ontime.id`)
- **Password:** 123456 (email/password only)
## Screens
- **Login** Two options: (1) **Login with phone (OTP)**: enter phone, tap Send OTP, enter SMS code, tap Verify; (2) **Login with email/password**: enter phone + password, Login or Register. Shows login token and request message in text fields.
- **Home** Launcher to Send message, Receipt message, Request & Response log; shows FCM token.
- **Send message** Type message, send to Firebase Realtime Database; sent payload/request shown in text.
- **Receipt message** Received FCM messages in text form.
- **Request & Response log** Text log of recent requests and responses (Auth, RTDB, FCM).
## Project layout
- `app/build.gradle` App config, package `id.ontime.merchant`, signing with `ontimekeystore.jks`.
- `app/google-services.json` Firebase config (unchanged).
- `app/ontimekeystore.jks` Debug/release signing (store/key password: `123456@ontime`, alias: `ontimekeystore`).