25 lines
886 B
Dart
25 lines
886 B
Dart
/// Host-facing interface for the Mattermost push 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 MattermostPushClient {
|
|
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,
|
|
);
|
|
}
|