diff --git a/docs/configurations/configure_push_gateway.md b/docs/configurations/configure_push_gateway.md new file mode 100644 index 0000000000..f7d8f29af1 --- /dev/null +++ b/docs/configurations/configure_push_gateway.md @@ -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 +``` diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index fc45d6590d..1bf870c5f7 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -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 =