iop/apps/client/lib/src/integrations/nexo/nexo_notification_client.dart

25 lines
890 B
Dart

/// Host-facing interface for the Nexo notification plugin.
///
/// All production access to the platform plugin singleton is routed through
/// implementations of this interface. The host integration depends on this
/// abstraction so tests can inject fakes without booting Firebase/FCM.
abstract interface class NexoNotificationClient {
Stream<Map<String, dynamic>> get onNotification;
Future<void> initialize();
Future<String?> getDeviceToken();
Future<void> setAuthToken(
String serverUrl,
String token, {
String? identifier,
});
Future<void> setSigningKey(String serverUrl, String signingKey);
set onDeviceTokenReady(Future<void> Function(String token)? callback);
set onNavigateToChannel(
void Function(String serverUrl, String channelId)? callback,
);
set onNavigateToThread(
void Function(String serverUrl, String rootId)? callback,
);
}