MethodChannelSendbirdNotificationHandler constructor

MethodChannelSendbirdNotificationHandler()

Implementation

MethodChannelSendbirdNotificationHandler() {
  eventChannel.receiveBroadcastStream().listen((event) {
    final Map<String, dynamic> map = jsonDecode(event as String);
    if (map.containsKey('inactive')) {
      _onMessageController.add(_handleMessage(map['inactive']));
    } else if (map.containsKey('active')) {
      _onMessageOpenedController.add(_handleMessage(map['active']));
    }
  });
}