startAutoRefresh method

Future<void> startAutoRefresh()

Start auto-refresh for the ad.

Auto-refresh interval is configured server-side in CloudX dashboard. Throws StateError if called before the controller is attached to an ad view.

Implementation

Future<void> startAutoRefresh() async {
  if (_adId == null) {
    throw StateError(
      'CloudXAdViewController is not attached to an ad view. '
      'Ensure the controller is passed to CloudXBannerView or CloudXMRECView.',
    );
  }
  await CloudX.startAutoRefresh(adId: _adId!);
}