tapButton method

void tapButton(
  1. NexusInAppMessage m,
  2. NexusInAppButton b
)

Handle a button tap: report the click, surface the action, auto-track event actions, then dismiss.

Implementation

void tapButton(NexusInAppMessage m, NexusInAppButton b) {
  unawaited(_report(m.id, 'click', buttonId: b.id));
  final action = NexusInAppAction(messageId: m.id, buttonId: b.id, action: b.action, url: b.url, event: b.event);
  if (b.action == 'event' && (b.event ?? '').isNotEmpty) {
    onTrackEvent?.call(b.event!);
  }
  onAction?.call(action);
  close();
}