setupNotificationsOpenAction static method

void setupNotificationsOpenAction(
  1. NotificationOpenAction action
)

Implementation

static void setupNotificationsOpenAction(NotificationOpenAction action) {
  WidgetsFlutterBinding.ensureInitialized();
  _notificationOpenChannel =
      const MethodChannel('assets_audio_player_notification');
  _notificationOpenChannel.setMethodCallHandler((call) async {
    switch (call.method) {
      case 'selectNotification':
        {
          final String audioId = call.arguments;
          __onNotificationClicked.add(
            ClickedNotificationWrapper(
              ClickedNotification(audioId: audioId),
            ),
          );
          break;
        }
    }
  });
  addNotificationOpenAction(action);
}