Μετάβαση στην κονσόλα

firebase::admob::NativeExpressAdView

#include <native_express_ad_view.h>

Loads and displays ads from AdMob Native Ads Express.

Summary

Each NativeExpressAdView object corresponds to a single AdMob Native Express ad placement. There are methods to load an ad, move it, show it and hide it, and retrieve the bounds of the ad onscreen.

NativeExpressAdView objects maintain a presentation state that indicates whether or not they're currently onscreen, as well as a set of bounds (stored in a BoundingBox struct), but otherwise provide information about their current state through Futures. Methods like Initialize, LoadAd, and Hide each have a corresponding Future from which the result of the last call can be determined. The two variants of MoveTo share a single result Future, since they're essentially the same action.

In addition, applications can create their own subclasses of NativeExpressAdView::Listener, pass an instance to the SetListener method, and receive callbacks whenever the presentation state or bounding box of the ad changes.

For example, you could initialize, load, and show a native express ad view while checking the result of the previous action at each step as follows:

namespace admob = ::firebase::admob;
admob::NativeExpressAdView* ad_view = new admob::NativeExpressAdView();
ad_view->Initialize(ad_parent, "YOUR_AD_UNIT_ID", desired_ad_size)

Then, later:

if (ad_view->InitializeLastResult().Status() ==
    ::firebase::kFutureStatusComplete &&
    ad_view->InitializeLastResult().Error() ==
    firebase::admob::kAdMobErrorNone) {
  ad_view->LoadAd(your_ad_request);
}

Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.

Constructors and Destructors

NativeExpressAdView()
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Creates an uninitialized NativeExpressAdView object.
~NativeExpressAdView()
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.

Public types

Position{
  kPositionTop = 0,
  kPositionBottom,
  kPositionTopLeft,
  kPositionTopRight,
  kPositionBottomLeft,
  kPositionBottomRight
}
enum
The possible screen positions for a NativeExpressAdView.
PresentationState{
  kPresentationStateHidden = 0,
  kPresentationStateVisibleWithoutAd,
  kPresentationStateVisibleWithAd,
  kPresentationStateOpenedPartialOverlay,
  kPresentationStateCoveringUI
}
enum
The presentation state of a NativeExpressAdView.

Public functions

Destroy()
Future< void >
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Cleans up and deallocates any resources used by the NativeExpressAdView.
DestroyLastResult() const
Future< void >
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Returns a Future containing the status of the last call to Destroy.
GetBoundingBox() const Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Retrieves the NativeExpressAdView's current onscreen size and location.
GetPresentationState() const Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Returns the current presentation state of the NativeExpressAdView.
Hide()
Future< void >
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
HideLastResult() const
Future< void >
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Returns a Future containing the status of the last call to Hide.
Initialize(AdParent parent, const char *ad_unit_id, AdSize size)
Future< void >
Deprecated. This class will be removed in a future version. Native Express Ads has been discontinued, and are no longer served.
Initializes the