@@ -217,10 +217,12 @@ class NotificationChannelManager {
217
217
/// Service for managing the notifications shown to the user.
218
218
class NotificationDisplayManager {
219
219
static Future <void > init () async {
220
+ assert (defaultTargetPlatform == TargetPlatform .android);
220
221
await NotificationChannelManager .ensureChannel ();
221
222
}
222
223
223
224
static void onFcmMessage (FcmMessage data, Map <String , dynamic > dataJson) {
225
+ assert (defaultTargetPlatform == TargetPlatform .android);
224
226
switch (data) {
225
227
case MessageFcmMessage (): _onMessageFcmMessage (data, dataJson);
226
228
case RemoveFcmMessage (): _onRemoveFcmMessage (data);
@@ -471,6 +473,8 @@ class NotificationDisplayManager {
471
473
required BuildContext context,
472
474
required Uri url,
473
475
}) {
476
+ assert (defaultTargetPlatform == TargetPlatform .android);
477
+
474
478
final globalStore = GlobalStoreWidget .of (context);
475
479
476
480
assert (debugLog ('got notif: url: $url ' ));
@@ -499,6 +503,7 @@ class NotificationDisplayManager {
499
503
/// generated with [NotificationOpenPayload.buildUrl] while creating
500
504
/// the notification.
501
505
static Future <void > navigateForNotification (Uri url) async {
506
+ assert (defaultTargetPlatform == TargetPlatform .android);
502
507
assert (debugLog ('opened notif: url: $url ' ));
503
508
504
509
NavigatorState navigator = await ZulipApp .navigator;
@@ -527,6 +532,8 @@ class NotificationDisplayManager {
527
532
}
528
533
529
534
static Future <void > removeNotificationsForAccount (Uri realmUri, int userId) async {
535
+ assert (defaultTargetPlatform == TargetPlatform .android);
536
+
530
537
final groupKey = _groupKey (realmUri, userId);
531
538
final activeNotifications = await _androidHost.getActiveNotifications (desiredExtras: [kExtraLastZulipMessageId]);
532
539
for (final statusBarNotification in activeNotifications) {
0 commit comments