Common Setup

Configuration shared by the web backend and the POS App — documented once, here.
Version: 1.0.0
Applies to: Web · POS App

Developed By: BugBuild Labs

What Is Shared

A few settings are not specific to one part of Sellino — the Laravel web backend and the POS App both depend on them. Rather than repeat those steps in each guide, they live on this page and every other guide links here.

Do this once. Complete this page a single time, then follow the app-specific steps in the POS App guide — it only covers what actually differs for the app.

Push Notifications (Firebase) — How It Works

Web backendPOS App

Sellino sends push notifications through Firebase Cloud Messaging (FCM) — order updates, delivery, returns/refunds, payouts and admin announcements. Push is optional: leave it off and everything else keeps working, only the phone-level alerts are missing.

Setup has two halves, and both are needed:

Server side — the backend sends

One Firebase service-account JSON uploaded in the admin panel under Settings → Push Notifications. Covers Android and iOS, for both apps.

App side — the phone receives

Each app needs its own Firebase config file (google-services.json / GoogleService-Info.plist). iOS needs one extra step — the APNs Auth Key.

Also worth knowing: in-app notifications (the bell icon and its list) are pulled from the backend over the API and always work with no setup at all. Firebase only affects notifications that reach the phone while the app is closed.

Note: Firebase is a Google service. A project is free to create, but any usage beyond its free tier is billed by Google and is not included in this item.

Work through steps 1 → 6 below. Steps 3–5 are iOS only — skip them if you only ship on Android.

1 · Create the Firebase Project

One project covers everything — the backend and the POS App.

  1. Open the Firebase console and create a project (or open an existing one).
  2. Go to Project settings → Service accounts and click Generate new private key. A .json file downloads — this is the service-account JSON the backend uses in step 6.
  3. Inside the same project, register the apps you plan to ship:
    • Android app for the POS App (its applicationId)
    • the matching iOS apps (their bundle ids), if you build for iOS

Keep the service-account JSON private. It can send notifications on your behalf. Never commit it to a public repository and never bundle it inside the mobile apps — it belongs on the server only.

Rebranded already? Register the Firebase apps with the final package / bundle ids you chose during rebranding, not the shipped defaults. Changing the id later means registering the app again and downloading a new config file.

Firebase consolecreate project
Service accountsgenerate private key

2 · Android Config File

POS App

In the Firebase console, open the Android app you registered and download google-services.json. Place it in the app's android/app/ folder:

PosAppSourceCode/android/app/google-services.json    <- from the POS App's Firebase Android app

Each app gets its own file — the file is tied to the package id it was generated for. Rebuild the app after adding it.

Package id must match. If applicationId in android/app/build.gradle.kts differs from the id registered in Firebase, the build fails or push silently never arrives. Rebrand first, then download the config file.

3 · iOS Config File iOS only

POS App

Download GoogleService-Info.plist from the iOS app you registered in Firebase, then add it to ios/Runner/ through Xcode — open the project, right-click the Runner group, choose Add Files to "Runner", and tick Copy items if needed plus the Runner target.

PosAppSourceCode/ios/Runner/GoogleService-Info.plist

Copying the file in Finder is not enough. If it is not added to the Runner target in Xcode, it never lands in the built app and Firebase fails to initialise at runtime.

4 · iOS APNs Auth Key iOS only — required

Apple does not let Firebase deliver to iPhones on its own. You create an APNs Auth Key (a .p8 file) in your Apple Developer account and hand it to Firebase. Without this, push on iOS silently never arrives — no error, just nothing.

  1. Sign in to the Apple Developer portal and open Certificates, Identifiers & Profiles → Keys:
    https://developer.apple.com/account/resources/authkeys/list
  2. Create a new key, tick Apple Push Notifications service (APNs), and download the .p8 file. Note the Key ID shown next to it, and your Team ID (top-right of the portal, or under Membership).
  3. In the Firebase console go to Project settings → Cloud Messaging → Apple app configuration → APNs Authentication Key and upload the .p8 together with the Key ID and Team ID.

The .p8 downloads only once. Apple will not let you download it a second time — store it somewhere safe. If you lose it, revoke the key and create a new one.

One key covers everything. A single APNs Auth Key works for every app under the same Apple Developer team. It also works for both development and production builds.

Portal layout changes. Apple reorganises the developer portal fairly often. If the link above does not land on the Keys page, sign in at developer.apple.com/account and look for Certificates, Identifiers & Profiles, then Keys. An Apple Developer Program membership is required — a free account cannot create APNs keys.

5 · Xcode Capabilities iOS only

Open the app's ios/Runner.xcworkspace in Xcode, select the Runner target → Signing & Capabilities, and add:

  • Push Notifications
  • Background Modes → tick Remote notifications

Do this for the iOS app you build. Make sure a valid Team is selected for signing at the same time.

6 · Admin Panel — Settings → Push Notifications

Web backend

The final step, and the one that actually turns sending on. In the admin panel open Settings → Push Notifications:

  1. Tick Enable push notifications.
  2. Upload the service-account JSON from step 1 — the Project ID fills in automatically.
  3. Click Test connection and confirm it succeeds before moving on.

Devices register themselves whenever a user signs in to either app, so notifications reach the right person across all of their devices — nothing to configure per user.

Non-technical step. This one is done entirely from the admin panel in a browser — no code, no terminal. Steps 1–5 are the developer's side of the same feature.

Settings → Pushenable + upload JSON
App notificationorder / delivery alerts

Verify & Troubleshoot

Test on a real device, not an emulator — the iOS simulator cannot receive push at all, and Android emulators need Google Play services.

  • Nothing arrives on Android — check google-services.json sits in android/app/, that its package id matches applicationId, and that the app was rebuilt after the file was added.
  • Android works, iOS does not — almost always the missing APNs Auth Key in the Firebase console, or the Xcode capabilities from step 5.
  • Test connection fails in the admin panel — the uploaded JSON is not a service-account key (it is the wrong file type), or the server cannot reach Google over HTTPS.
  • Only some users get notified — devices register on sign-in. A user who has never signed in on that device has no token yet.
  • In-app bell works but the phone stays silent — that is exactly the split described above: the API side is fine, the Firebase side is not finished.

API Base URL & HTTPS

POS App

The app is just a client of your backend, and uses one config file per environment:

POS App -> lib/core/env/prod_env.dart   (kBaseUrl)   ← release builds
           lib/core/env/dev_env.dart    (kBaseUrl)   ← debug / profile builds

prod -> 'https://yourdomain.com/api/v10'

Release builds always read prod_env.dart, and refuse to start if the URL still points at a dev host or the App API key is still empty.

HTTPS is not optional. Modern Android and iOS block plain HTTP and self-signed certificates by default — the app will show network errors that look like a broken backend. Confirm https://yourdomain.com/api/v10 loads in a browser before building the app.

Image URLs are resolved from the API origin automatically, so there is no separate media URL to configure. Detailed, app-specific configuration lives in the POS App guide.

Real-time (Reverb)

Web backend

The admin panel's live features run on Laravel Reverb. There are no REVERB_* keys in .env — host, port, scheme and credentials are seeded on install and managed from Dashboard → Settings → Realtime (Websocket). Restart the Reverb daemon after changing them. Server-side installation — daemon, Supervisor, proxy — is covered in Real-time Chat (Reverb).

POS App: the app does not open a websocket — its inbox refreshes by polling the API — so there is nothing Reverb-related to configure on the app side.

Done here? Head back to Quick Start to continue, or open the Web (Admin & POS) or POS App guide for the parts specific to each.