chore: Make push gateway configurable
Signed-off-by: Krille <c.kussowski@famedly.com>
This commit is contained in:
parent
03ea244e64
commit
92db578365
3 changed files with 30 additions and 11 deletions
|
|
@ -21,9 +21,10 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluffychat/utils/push_helper.dart';
|
||||
import 'package:fluffychat/widgets/fluffy_chat_app.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:flutter_new_badger/flutter_new_badger.dart';
|
||||
|
|
@ -32,8 +33,6 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:unifiedpush/unifiedpush.dart';
|
||||
import 'package:unifiedpush_ui/unifiedpush_ui.dart';
|
||||
|
||||
import 'package:fluffychat/utils/push_helper.dart';
|
||||
import 'package:fluffychat/widgets/fluffy_chat_app.dart';
|
||||
import '../config/app_config.dart';
|
||||
import '../config/setting_keys.dart';
|
||||
import '../widgets/matrix.dart';
|
||||
|
|
@ -186,7 +185,8 @@ class BackgroundPush {
|
|||
currentPushers.first.lang == 'en' &&
|
||||
currentPushers.first.data.url.toString() == gatewayUrl &&
|
||||
currentPushers.first.data.format ==
|
||||
AppConfig.pushNotificationsPusherFormat &&
|
||||
AppSettings.pushNotificationsPusherFormat
|
||||
.getItem(matrix!.store) &&
|
||||
mapEquals(
|
||||
currentPushers.single.data.additionalProperties,
|
||||
{"data_message": pusherDataMessageFormat},
|
||||
|
|
@ -226,7 +226,8 @@ class BackgroundPush {
|
|||
lang: 'en',
|
||||
data: PusherData(
|
||||
url: Uri.parse(gatewayUrl!),
|
||||
format: AppConfig.pushNotificationsPusherFormat,
|
||||
format: AppSettings.pushNotificationsPusherFormat
|
||||
.getItem(matrix!.store),
|
||||
additionalProperties: {"data_message": pusherDataMessageFormat},
|
||||
),
|
||||
kind: 'http',
|
||||
|
|
@ -315,7 +316,8 @@ class BackgroundPush {
|
|||
}
|
||||
}
|
||||
await setupPusher(
|
||||
gatewayUrl: AppConfig.pushNotificationsGatewayUrl,
|
||||
gatewayUrl:
|
||||
AppSettings.pushNotificationsGatewayUrl.getItem(matrix!.store),
|
||||
token: _fcmToken,
|
||||
);
|
||||
}
|
||||
|
|
@ -427,7 +429,10 @@ class BackgroundPush {
|
|||
}
|
||||
|
||||
class UPFunctions extends UnifiedPushFunctions {
|
||||
final List<String> features = [/*list of features*/];
|
||||
final List<String> features = [
|
||||
/*list of features*/
|
||||
];
|
||||
|
||||
@override
|
||||
Future<String?> getDistributor() async {
|
||||
return await UnifiedPush.getDistributor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue