Skip to main content

unified_ads_platform_interface 1.0.0 copy "unified_ads_platform_interface: ^1.0.0" to clipboard
unified_ads_platform_interface: ^1.0.0 copied to clipboard

Common platform interface for unified_ads: the AdNetworkAdapter contract, shared ad models, and the adapter registry.

unified_ads_platform_interface #

The common platform interface for unified_ads. It contains:

  • the AdNetworkAdapter contract that every network adapter implements;
  • the shared models (AdConfig, NetworkConfig, AdError, AdEvent, BannerSize, RewardItem, …);
  • the AdapterRegistry that adapters register with from their dartPluginClass;
  • the ConsentProvider / TrackingAuthorization abstractions;
  • the pluggable AdsLogger, which is silent by default.

App developers don't depend on this package directly. unified_ads re-exports all of it.

It is meant for adapter authors. Most adapters extend BridgedAdNetworkAdapter, which implements the contract once: it never throws, maps PlatformException → AdError, tracks loaded ads, and translates native events. A new adapter then only provides its Pigeon host API. The step-by-step checklist is TEMPLATE.md, and the contract is described in ARCHITECTURE.md §5.

class MyNetworkAdapter extends BridgedAdNetworkAdapter {
  /// Called by Flutter's plugin registrant (pubspec `dartPluginClass`).
  static void registerWith() {
    AdapterRegistry.instance.register(MyNetworkAdapter());
  }
  // ...
}

The core never depends on an adapter. Adapters depend only on this package, which is why an app links exactly the networks it adds.

1
likes
160
points
225
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Common platform interface for unified_ads: the AdNetworkAdapter contract, shared ad models, and the adapter registry.

Repository (GitHub)
View/report issues
Contributing

Topics

#ads #monetization #advertising

License

MIT (license)

Dependencies

flutter

More

Packages that depend on unified_ads_platform_interface