Skip to content

Commit

Permalink
Configurable push gateway with PUSH_NOTIFICATIONS_GATEWAY_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdat committed Mar 11, 2025
1 parent 551bca7 commit 8888ce8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/configurations/configure_push_gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Configuration for push gateway

1. get the push gateway url and add the postfix
```
{pushGatewayUrl}/_matrix/push/v1/notify
```
Fx: `https://sygnal.domain.dev/_matrix/push/v1/notify`

2. build the app with `--dart-define` and the param `PUSH_NOTIFICATIONS_GATEWAY_URL`

Fx:
```
flutter build apk --release --dart-define=PUSH_NOTIFICATIONS_GATEWAY_URL=https://sygnal.domain.dev/_matrix/push/v1/notify
```
9 changes: 7 additions & 2 deletions lib/config/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ abstract class AppConfig {
? "app.twake.ios.chat"
: "app.twake.ios.chat.sandbox"
: "app.twake.android.chat";
static const String pushNotificationsGatewayUrl =
'https://sygnal.lin-saas.dev/_matrix/push/v1/notify';

static const String _pushNotificationsGatewayUrlEnv = String.fromEnvironment(
'PUSH_NOTIFICATIONS_GATEWAY_URL',
defaultValue: 'https://sygnal.lin-saas.dev/_matrix/push/v1/notify',
);

static String pushNotificationsGatewayUrl = _pushNotificationsGatewayUrlEnv;
static const String pushNotificationsPusherFormat = 'event_id_only';
static const String emojiFontName = 'Noto Emoji';
static const String emojiFontUrl =
Expand Down

0 comments on commit 8888ce8

Please sign in to comment.