Skip to content

Apps and clients

Mobile app setup

The mobile app is an Expo (React Native) project with its own repository (SharkhexClassifiedsApp) and build guide (docs/build-local.md there). This page covers what the backend provides for it and what to set on the server so an app build can talk to it.

What the app uses

  • API: every screen talks to https://your-domain/api/v1. The full description is at /api/doc (and /api/doc.json for tools).
  • Sign-in: POST /api/v1/users/login with email and password returns a short-lived access token and a refresh token; POST /api/v1/users/token/refresh renews them. Tokens are signed with APP_SECRET, so changing it signs everyone out of the app.
  • Facebook and Apple: POST /api/v1/users/login/facebook takes the app's Facebook access token (Android) or Limited Login token (iOS); POST /api/v1/users/login/apple takes the Sign in with Apple identity token. Both check the token with Facebook or Apple, create the account on first use (or link the account with the same email) and answer like the email sign-in. GET /api/v1/platform lists the ones that are on under features.socialLogin, and the app shows only those.
  • Language: the app shows everything in the install's language, locale in GET /api/v1/platform, and the API answers in it. The brand's locales.default is used until the app has heard from the server.
  • Platform details: GET /api/v1/platform returns the name, language, currency and the other settings the app needs to look like the brand.
  • Push notifications: the app registers its Expo push token with POST /api/v1/devices. The server sends through Expo when EXPO_DSN is set.

Server settings for the app

SettingWhereWhy
EXPO_DSNenvironmentPush notifications (expo://ACCESS_TOKEN@default; the token comes from the Expo account of the app).
Public URLAdmin, Settings, PlatformLinks in emails and shared listings open the right address.
Facebook app idFB_ID, FB_SECRETFacebook sign-in, on the website and in the app (the same Facebook app; add the iOS and Android apps to it).
iOS bundle IDAdmin, Settings, AppsThe app's bundle ID (identity.bundleId in its brand.json): Sign in with Apple only accepts tokens issued to it.
Sign in with AppleAdmin, Settings, AppsTurns the Apple button on in the iOS app. The App Store requires it when the app offers Facebook sign-in.

Per brand

Each brand gets its own app build (name, icon, colours, store listing) pointing at its own install's address. Keep the API address, the brand name and the support email in the app build the same as on the server.

Found a mistake? Tell us.