chore(android,base,interface): Move notification stuff into Moxxy
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:moxplatform_platform_interface/moxplatform_platform_interface.dart';
|
||||
|
||||
class AndroidNotificationsImplementation extends NotificationsImplementation {
|
||||
final MoxplatformApi _api = MoxplatformApi();
|
||||
|
||||
final EventChannel _channel =
|
||||
const EventChannel('me.polynom/notification_stream');
|
||||
|
||||
@override
|
||||
Future<void> createNotificationChannels(
|
||||
List<NotificationChannel> channels) async {
|
||||
return _api.createNotificationChannels(channels);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteNotificationChannels(List<String> ids) {
|
||||
return _api.deleteNotificationChannels(ids);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createNotificationGroups(List<NotificationGroup> groups) async {
|
||||
return _api.createNotificationGroups(groups);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteNotificationGroups(List<String> ids) {
|
||||
return _api.deleteNotificationGroups(ids);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> showMessagingNotification(
|
||||
MessagingNotification notification,
|
||||
) async {
|
||||
return _api.showMessagingNotification(notification);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> showNotification(RegularNotification notification) async {
|
||||
return _api.showNotification(notification);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> dismissNotification(int id) async {
|
||||
return _api.dismissNotification(id);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setNotificationSelfAvatar(String path) async {
|
||||
return _api.setNotificationSelfAvatar(path);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setI18n(NotificationI18nData data) {
|
||||
return _api.setNotificationI18n(data);
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<NotificationEvent> getEventStream() => _channel
|
||||
.receiveBroadcastStream()
|
||||
.cast<Object>()
|
||||
.map(NotificationEvent.decode);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:moxplatform_android/src/contacts_android.dart';
|
||||
import 'package:moxplatform_android/src/crypto_android.dart';
|
||||
import 'package:moxplatform_android/src/isolate_android.dart';
|
||||
import 'package:moxplatform_android/src/notifications_android.dart';
|
||||
import 'package:moxplatform_android/src/platform_android.dart';
|
||||
import 'package:moxplatform_platform_interface/moxplatform_platform_interface.dart';
|
||||
|
||||
@@ -12,7 +11,6 @@ class MoxplatformAndroidPlugin extends MoxplatformInterface {
|
||||
MoxplatformInterface.contacts = AndroidContactsImplementation();
|
||||
MoxplatformInterface.crypto = AndroidCryptographyImplementation();
|
||||
MoxplatformInterface.handler = AndroidIsolateHandler();
|
||||
MoxplatformInterface.notifications = AndroidNotificationsImplementation();
|
||||
MoxplatformInterface.platform = AndroidPlatformImplementation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user