Flutter configuration reference
Reference for the files delivered in Main_File. Documentation updated 22 September 2026. Examples use fictional IDs and balances; replace them with values from your installation.
Socket host, port and transport scheme
The delivered SocketManager constructs http://$ip:$port. Port 443 alone does not
select HTTPS. For a TLS-only socket proxy, update that URL construction to HTTPS and verify the release app on a
device. There is no scheme key in AppChatConfig. Follow the socket
transport notes; do not assume the build command below fixes this source limitation.
Every AppChatConfig key
The buyer configuration file is flutter_app/lib/config/appchat_config.dart. These five values are
compile-time constants. --dart-define overrides the source default for that build; it is not a
runtime .env file. A hot reload or backend-only edit does not change the compiled value.
| Dart member / define | Type | Exact shipped default | Required? | Meaning and example |
|---|---|---|---|---|
apiBaseUrlAPPCHAT_API_BASE_URL |
String | https://your-domain.com/ | Required deployment value; placeholder is not usable | Public PHP base directory, before api/. Example https://api.example.com/ or https://example.com/appchat/public/. normalizedApiBaseUrl() adds a trailing slash; call_server_api.dart appends api/. |
apiKeyAPPCHAT_API_KEY |
String | CHANGE_ME_APPCHAT_API_KEY | Required deployment value | Sent as API-KEY and socket conn.apiKey. Must match the PHP and Node API_KEY. This is embedded in the client and is not an admin/server secret. |
defaultSocketHostAPPCHAT_SOCKET_HOST |
String | socket.your-domain.com | Configure for a usable fallback | Hostname only, e.g. socket.example.com; no /socket.io/ path. Session responses can supply socket_ip and override this fallback. |
defaultSocketPortAPPCHAT_SOCKET_PORT |
int | 443 | Optional when public TLS uses 443 | Decimal public socket port (1–65535), not necessarily the internal Node port. Invalid non-integer dart-define values fall back to the default. Session socket_port can override it. |
shareBaseUrlAPPCHAT_SHARE_BASE_URL |
String | https://your-domain.com/share | Required if sharing is offered | Base used by app_share_helper.dart to construct type-specific share links. Set a working public share/deep-link destination, e.g. https://example.com/share, without a trailing slash. This value alone does not deploy a share website or configure OS app links. |
The APPCHAT_ keys above match the delivered source. Use these exact names in build commands. There are no hidden extra String.fromEnvironment/int.fromEnvironment keys in the delivered
Flutter lib directory.
Set, build, then verify
Run inside flutter_app. The following is a macOS/Linux shell example; in PowerShell put the command on one line or use PowerShell continuation syntax.
flutter build appbundle --release \
--dart-define=APPCHAT_API_BASE_URL=https://api.example.com/ \
--dart-define=APPCHAT_API_KEY=YOUR_SHARED_APP_KEY \
--dart-define=APPCHAT_SOCKET_HOST=socket.example.com \
--dart-define=APPCHAT_SOCKET_PORT=443 \
--dart-define=APPCHAT_SHARE_BASE_URL=https://example.com/share
- Set PHP SOCKET_IP/SOCKET_PORT to the same public destination. The auth response is authoritative when present; changing only the Dart fallback may appear to do nothing.
- Install the newly built app and sign in again.
- Confirm the requested API hostname in development logs, helper/config response and session socket values.
- Verify appCon=1, enter a room, exchange a message between two devices, then open a shared profile/room link.
Configuration outside this file
These are platform/service setup values, not AppChatConfig keys.
- Firebase: supply your android/app/google-services.json, ios/Runner/GoogleService-Info.plist and generated lib/firebase_options.dart. Google sign-in requires the correct Android fingerprints and iOS URL scheme.
- Android: applicationId/namespace in android/app/build.gradle.kts, app label and release keystore configuration.
- iOS: Runner bundle identifier, development team, signing/provisioning, capabilities, privacy purpose strings and version/build number. See the iOS release guide.
- Agora: app ID comes from helper/config; the certificate stays on PHP. Channel tokens come from room entry responses.
- Purchases: product IDs in recharge_packages must match the products in the buyer's own Play Console/App Store Connect account.
- Branding/legal URLs: update the app logo, displayed name, and privacy/terms/support destinations in the relevant screen/helper files before release.
Backend DB, Redis, Firebase Admin, billing verification and Bunny credentials belong in backend .env/service-account files, never in this Dart class. Consult the Environment Files and service setup sections in index.html.