reportSlotFirstRender method

void reportSlotFirstRender(
  1. CEPTriggerPayload payload
)

Fired when an inline slot first paints. Records the deduped Digia impression as a CarouselViewed or StoriesViewed depending on the campaign type. Mirrors Android's reportSlotFirstRender.

Implementation

void reportSlotFirstRender(CEPTriggerPayload payload) {
  final campaign = _campaignStore.find(payload.campaignKey);
  if (campaign == null) return;
  final config = campaign.config;
  switch (config) {
    case InlineCarouselCampaignConfig(:final inlineConfig):
      _events.digiaImpressionOnce(
        payload,
        CarouselViewed(
          itemTotal: inlineConfig.items.length,
          slotKey: inlineConfig.slotKey,
          screenName: _currentScreen,
        ),
      );
    case InlineStoryCampaignConfig(:final storyConfig):
      _events.digiaImpressionOnce(
        payload,
        StoriesViewed(
          itemTotal: storyConfig.items.length,
          slotKey: storyConfig.slotKey,
          screenName: _currentScreen,
        ),
      );
    case _:
      break;
  }
}