Banner View
This section contains information about Banner Views (also called Ad Views), if you are looking for examples, head to the Blueprint examples or the C++ examples.
What are they?
Banner views occupy a spot within an app's layout, either at the top or bottom of the device screen. They stay on screen while users are interacting with the app, and can refresh automatically after a certain period of time.
API Reference
Methods
Initialize
Description
Initializes the AdView. This method must be called before any other methods on the object.
For C++ only, this method is called automatically when you create an Ad View in Blueprints.
Parameters
- Width
int32
: The width of the Ad View. - Height
int32
: The height of the AdView. - AdUnit
FStringView
: The AdUnit used to display the ad. - Callback
FAdMobCallback
: Callback called when the AdView has been initialized.
LoadAd
Description
Loads an ad. This method must be called before trying to display an ad. It takes time to complete.
Parameters
- Keywords
const TArray<FString>&
: The keywords for the ad. - Callback
FAdMobCallback
: Callback called when the ad has been loaded.
Show
Description
Shows the ad. An ad has the be loaded first by using LoadAd.
Parameters
- Callback
FAdMobCallback
: Callback called when the ad is shown.
Hide
Description
Hides the AdView.
Parameters
- Callback
FAdMobCallback
: Callback called when the AdView has been hidden.
Pause
Description
Pauses the AdView.
Parameters
- Callback
FAdMobCallback
: Callback called when the AdView has been paused.
Resume
Description
Resumes the AdView previously paused.
Parameters
- Callback
FAdMobCallback
: Callback called when the AdView has been resumed.
MoveTo
Description
Moves the AdView to the desired location.
Parameters
- X
int32
: The X coordinate where we want the AdView. - Y:
int32
The Y coordinate where we want the AdView. - Callback
FAdMobCallback
: Callback called when the AdView has been moved.
MoveTo
Description
Moves the AdView to the desired location.
Parameters
- Position: The position where we want to move the AdView to.
- Callback
FAdMobCallback
: Callback called when the AdView has been moved.
Destroy
Description
Destroys the AdView.
Parameters
- Callback
FAdMobCallback
: Callback called when the AdView has been destroyed.
Events
OnAdOpened
Called when the user taped the ad and the overlay that covers the screen appeared.
OnAdClicked
Called when the user clicked on the ad.
OnAdClosed
Called when the user is about to return to the app after tapping on an ad.