GoogleMobileAds.Api.NativeOverlayAd

Native Overlay ads use the Native ad format to show overlays on top of the application.

Summary

They stay on screen while users are interacting with the app.

Events

OnAdClicked
Action
Raised when a click is recorded for an ad.
OnAdFullScreenContentClosed
Action
Raised when the ad closed full-screen content.
OnAdFullScreenContentOpened
Action
Raised when an ad opened full-screen content.
OnAdImpressionRecorded
Action
Raised when an impression is recorded for an ad.
OnAdPaid
Action< AdValue >
Raised when the ad is estimated to have earned money.

Public static functions

Load(string adUnitId, AdRequest request, NativeAdOptions options, Action< NativeOverlayAd, LoadAdError > adLoadCallback)
void
Loads a native overlay ad.

Public functions

Destroy()
void
Destroys the native overlay ad.
GetResponseInfo()
Fetches the ad request response info.
GetTemplateHeightInPixels()
float
Returns the height of the native overlay in pixels.
GetTemplateWidthInPixels()
float
Returns the width of the native overlay in pixels.
Hide()
void
Hides the ad from being shown.
RenderTemplate(NativeTemplateStyle nativeTemplateStyle, AdSize adSize, AdPosition adPosition)
void
Renders the native overlay ad at provided AdPosition with the given adSize.
RenderTemplate(NativeTemplateStyle nativeTemplateStyle, AdSize adSize, int x, int y)
void
Renders the native overlay ad at x,y coordinates with the provided size.
RenderTemplate(NativeTemplateStyle nativeTemplateStyle, AdPosition adPosition)
void
Renders the native overlay ad at provided AdPosition using the default size.
RenderTemplate(NativeTemplateStyle nativeTemplateStyle, int x, int y)
void
Renders the native Overlay ad at x,y coordinates using the default size.
SetTemplatePosition(AdPosition position)
void
Sets the position of the native overlay ad using standard position.
SetTemplatePosition(int x, int y)
void
Sets the position of the native overlay ad using custom position.
Show()
void
Shows the previously hidden ad.

Events

OnAdClicked

Action OnAdClicked

Raised when a click is recorded for an ad.

OnAdFullScreenContentClosed

Action OnAdFullScreenContentClosed

Raised when the ad closed full-screen content.

On iOS, this event is only raised when an ad opens an overlay, not when opening a new application such as Safari or the App Store.

OnAdFullScreenContentOpened

Action OnAdFullScreenContentOpened

Raised when an ad opened full-screen content.

OnAdImpressionRecorded

Action OnAdImpressionRecorded

Raised when an impression is recorded for an ad.

OnAdPaid

Action< AdValue > OnAdPaid

Raised when the ad is estimated to have earned money.

Public static functions

Load

void Load(
  string adUnitId,
  AdRequest request,
  NativeAdOptions options,
  Action< NativeOverlayAd, LoadAdError > adLoadCallback
)

Loads a native overlay ad.

Details
Parameters
adUnitId
An ad unit ID created in the AdMob or Ad Manager UI.
request
An ad request object containing targeting information used to fetch the ad.
options
Native Ad Options for configuring image and video rendering settings.
adLoadCallback
Callback to inform the app if the load request was successful or failed to fetch the ad.

Public functions

Destroy

void Destroy()

Destroys the native overlay ad.

GetResponseInfo

ResponseInfo GetResponseInfo()

Fetches the ad request response info.

Details
Returns
The ad request response info or null if the ad is not loaded.

GetTemplateHeightInPixels

float GetTemplateHeightInPixels()

Returns the height of the native overlay in pixels.

GetTemplateWidthInPixels

float GetTemplateWidthInPixels()

Returns the width of the native overlay in pixels.

Hide

void Hide()

Hides the ad from being shown.

RenderTemplate

void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdSize adSize,
  AdPosition adPosition
)

Renders the native overlay ad at provided AdPosition with the given adSize.

Details
Parameters
nativeTemplateStyle
The Template styling used to customize the native ad.
adSize
The size of the overlay used to render the native ad.
adPosition
The position of the overlay in screen space.

RenderTemplate

void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdSize adSize,
  int x,
  int y
)

Renders the native overlay ad at x,y coordinates with the provided size.

Details
Parameters
nativeTemplateStyle
The Template styling used to customize the native ad.
adSize
The size of the overlay used to render the native ad.
x
The x coordinate position of the overlay in screen space.
y
The y coordinate position of the overlay in screen space.

RenderTemplate

void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdPosition adPosition
)

Renders the native overlay ad at provided AdPosition using the default size.

Details
Parameters
nativeTemplateStyle
The Template styling used to customize the native ad.
adPosition
The position of the overlay in screen space.

RenderTemplate

void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  int x,
  int y
)

Renders the native Overlay ad at x,y coordinates using the default size.

Details
Parameters
nativeTemplateStyle
The Template styling used to customize the native ad.
x
The x coordinate position of the overlay in screen space.
y
The y coordinate position of the overlay in screen space.

SetTemplatePosition

void SetTemplatePosition(
  AdPosition position
)

Sets the position of the native overlay ad using standard position.

Details
Parameters
position
The position of the overlay in screen space.

SetTemplatePosition

void SetTemplatePosition(
  int x,
  int y
)

Sets the position of the native overlay ad using custom position.

Details
Parameters
x
The x coordinate position of the overlay in screen space.
y
The y coordinate position of the overlay in screen space.

Show

void Show()

Shows the previously hidden ad.