getAttributionData static method

Stream<MetrixAttribution> getAttributionData()

Implementation

static Stream<MetrixAttribution> getAttributionData() async* {
  if (!isWeb) {
    _channel.invokeMethod('initAttributionListener');
    _attributionInfoEventChannel ??= const EventChannel('MetrixAttributionEvent');
    yield* _attributionInfoEventChannel?.receiveBroadcastStream().map((attribution) => MetrixAttribution.fromMap(attribution)) ?? Stream.empty();
  } else {
    yield* Stream.empty();
  }
}