AdsManagerDelegate class

Delegate for ad events or errors that occur during ad or stream initialization and playback.

Platform-Specific Features

This class contains an underlying implementation provided by the current platform. Once a platform implementation is imported, the examples below can be followed to use features provided by a platform's implementation.

Below is an example of setting platform-specific creation parameters for iOS and Android:

PlatformAdsManagerDelegateCreationParams params =
    const PlatformAdsManagerDelegateCreationParams();

if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) {
  params = IOSAdsManagerDelegateCreationParams
      .fromPlatformAdsManagerDelegateCreationParams(
    params,
  );
} else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) {
  params = AndroidAdsManagerDelegateCreationParams
      .fromPlatformAdsManagerDelegateCreationParams(
    params,
  );
}

final AdsManagerDelegate delegate = AdsManagerDelegate.fromPlatformCreationParams(
  params,
);

Below is an example of accessing the platform-specific implementation for iOS and Android:

final AdsManagerDelegate delegate = AdsManagerDelegate();

if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) {
  final IOSAdsManagerDelegate iosDelegate = delegate.platform as IOSAdsManagerDelegate;
} else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) {
  final AndroidAdsManagerDelegate androidDelegate =
      delegate.platform as AndroidAdsManagerDelegate;
}

Constructors

AdsManagerDelegate({void onAdEvent(AdEvent event)?, void onAdErrorEvent(AdErrorEvent event)?})
Constructs an AdsManagerDelegate.
AdsManagerDelegate.fromPlatform(PlatformAdsManagerDelegate platform)
Constructs a AdsManagerDelegate from a specific platform implementation.
AdsManagerDelegate.fromPlatformCreationParams(PlatformAdsManagerDelegateCreationParams params)
Constructs an AdsManagerDelegate from creation params for a specific platform.

Properties

hashCode int
The hash code for this object.
no setterinherited
onAdErrorEvent → void Function(AdErrorEvent event)?
Invoked when there was an error playing the ad. Log the error and resume playing content.
no setter
onAdEvent → void Function(AdEvent event)?
Invoked when there is an AdEvent.
no setter
platform → PlatformAdsManagerDelegate
Implementation of PlatformAdsManagerDelegate for the current platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited