build: Add unifiedpush_ui package
Add unifiedpush_ui as part of unifiedpush was split off into it.
This commit is contained in:
parent
de7b85819f
commit
96ecc878b4
3 changed files with 35 additions and 3 deletions
|
|
@ -30,6 +30,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|||
import 'package:http/http.dart' as http;
|
||||
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';
|
||||
|
|
@ -323,9 +324,8 @@ class BackgroundPush {
|
|||
}
|
||||
|
||||
Future<void> setupUp() async {
|
||||
// Blocked by https://codeberg.org/UnifiedPush/flutter-connector/issues/2
|
||||
// ignore: deprecated_member_use
|
||||
await UnifiedPush.registerAppWithDialog(matrix!.context);
|
||||
await UnifiedPushUi(matrix!.context, ["default"], UPFunctions())
|
||||
.registerAppWithDialog();
|
||||
}
|
||||
|
||||
Future<void> _newUpEndpoint(String newEndpoint, String i) async {
|
||||
|
|
@ -403,3 +403,26 @@ class BackgroundPush {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class UPFunctions extends UnifiedPushFunctions {
|
||||
final List<String> features = [/*list of features*/];
|
||||
@override
|
||||
Future<String?> getDistributor() async {
|
||||
return await UnifiedPush.getDistributor();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getDistributors() async {
|
||||
return await UnifiedPush.getDistributors(features);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> registerApp(String instance) async {
|
||||
await UnifiedPush.registerApp(instance, features);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> saveDistributor(String distributor) async {
|
||||
await UnifiedPush.saveDistributor(distributor);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2096,6 +2096,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
unifiedpush_ui:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: unifiedpush_ui
|
||||
sha256: cf86f0214f37debd41f25c0425c8489df85e27f9f8784fed571eb7a86d39ba11
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
universal_html:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ dependencies:
|
|||
tor_detector_web: ^1.1.0
|
||||
uni_links: ^0.5.1
|
||||
unifiedpush: ^5.0.1
|
||||
unifiedpush_ui: ^0.1.0
|
||||
universal_html: ^2.2.4
|
||||
url_launcher: ^6.2.5
|
||||
video_compress: ^3.1.3
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue