companion library
Building blocks shared by the companion packages
(prebid_mobile_sdk_gam, prebid_mobile_sdk_admob,
prebid_mobile_sdk_max).
Not meant for apps, which use
package:prebid_mobile_sdk/prebid_mobile_sdk.dart and the companion
packages' own libraries. It follows semantic versioning like the rest of
the package: a breaking change to it comes only with a new major version,
so a companion package depending on prebid_mobile_sdk: ^1.0.0 keeps
working with every 1.x release.
Classes
- AdViewChannel
- The method channel of one native ad view, named before the view exists.
- CompanionAdChannel
-
A companion package's method channel for fullscreen ads, shared by every
ad of one kind (e.g.
prebid_mobile_sdk_gam/interstitial). - CompanionFullscreenAd
- Base class of the companion packages' interstitial and rewarded ads.
- PreloadedBanner
-
The Dart side of one preloaded banner (ADR-0008), shared by the core's
PrebidPreloadedBannerAdand the companion packages' preloaded banners. - PreloadedBannerView
- Shows a PreloadedBanner at the size it reports; the slot stays empty while the banner isn't loaded. Removing the view keeps the banner.
Mixins
-
AdViewState<
T extends StatefulWidget> -
The state of a widget that shows one native ad view: the core
PrebidBannerAdand the companion packages' banner and native ads.
Functions
-
adEventError(
Object? args) → String -
The error message of a failure event: the payload itself (a String) or
its
errorentry. -
dispatchBannerEvent(
PrebidBannerAdListener? listener, PrebidBannerVideoListener? videoListener, MethodCall event) → bool -
Calls the
listenerorvideoListenercallback for a banner viewevent. Returns whether the event is one of theirs. -
dispatchInterstitialEvent(
PrebidInterstitialAdListener? listener, String event, Map? args) → bool -
Calls the
listenercallback for an interstitialevent. Returns whether the event is one of PrebidInterstitialAdListener's. -
dispatchRewardedEvent(
PrebidRewardedAdListener? listener, String event, Map? args) → bool -
Calls the
listenercallback for a rewardedevent. Returns whether the event is one of PrebidRewardedAdListener's. -
flatSizes(
List< Size> sizes) → List<int> -
sizesas the flat[width, height, ...]list of whole dps the native banner views read (additionalSizes). -
impOrtbWithGpid(
String? impOrtbConfig, String? gpid) → String? -
impOrtbConfigwithext.gpidset togpid(unless it already sets one), for ad units without a GPID setter. Unchanged without agpidor whenimpOrtbConfigis not a JSON object. -
impOrtbWithPbAdSlot(
String? impOrtbConfig, String? pbAdSlot) → String? -
impOrtbConfigwithext.data.pbadslotset topbAdSlot(unless it already sets one), for ad units without a pbAdSlot setter. Unchanged without apbAdSlotor whenimpOrtbConfigis not a JSON object. -
rewardFromPayload(
Map? args) → PrebidReward -
Builds the PrebidReward of an
onUserEarnedRewardpayload. Every companion sends the same keys (rewardType,rewardCountand, when the SDK provides one,rewardExtas a JSON string or map), so rewards look the same whichever ad server renders them.
Typedefs
- CompanionAdEventHandler = void Function(String event, Map? args)
- Handles one native event for an ad: the event name and its payload.