Stay organized with collections
Save and categorize content based on your preferences.
firebase::gma::AdListener
#include <types.h>
A listener for receiving notifications during the lifecycle of a BannerAd.
Summary
Public functions
|
OnAdClicked()
|
virtual void
Called when a click is recorded for an ad.
|
OnAdClosed()
|
virtual void
Called when the user is about to return to the application after clicking on an ad.
|
OnAdImpression()
|
virtual void
Called when an impression is recorded for an ad.
|
OnAdOpened()
|
virtual void
Called when an ad opens an overlay that covers the screen.
|
Public functions
OnAdClicked
virtual void OnAdClicked()
Called when a click is recorded for an ad.
OnAdClosed
virtual void OnAdClosed()
Called when the user is about to return to the application after clicking on an ad.
OnAdImpression
virtual void OnAdImpression()
Called when an impression is recorded for an ad.
OnAdOpened
virtual void OnAdOpened()
Called when an ad opens an overlay that covers the screen.
~AdListener
virtual ~AdListener()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003efirebase::gma::AdListener\u003c/code\u003e is a class used for receiving notifications during the lifecycle of a BannerAd.\u003c/p\u003e\n"],["\u003cp\u003eIt provides virtual functions such as \u003ccode\u003eOnAdClicked\u003c/code\u003e, \u003ccode\u003eOnAdClosed\u003c/code\u003e, \u003ccode\u003eOnAdImpression\u003c/code\u003e, and \u003ccode\u003eOnAdOpened\u003c/code\u003e to handle ad interactions.\u003c/p\u003e\n"],["\u003cp\u003eThese functions are triggered when an ad is clicked, closed, displayed, or opens an overlay respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAdListener\u003c/code\u003e class can be extended to implement custom behaviors for handling ad events.\u003c/p\u003e\n"]]],["The `AdListener` class provides notifications for `BannerAd` lifecycle events. Key actions include `OnAdClicked` (a click is recorded), `OnAdClosed` (user returns to the app after ad interaction), `OnAdImpression` (an ad impression is recorded), and `OnAdOpened` (an ad overlay opens). It also includes a destructor `~AdListener`. These actions represent virtual functions that are called during specific ad interactions and visibility changes.\n"],null,["# firebase::gma::AdListener Class Reference\n\nfirebase::gma::AdListener\n=========================\n\n\n`#include \u003ctypes.h\u003e`\n\nA listener for receiving notifications during the lifecycle of a BannerAd.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~AdListener](#classfirebase_1_1gma_1_1_ad_listener_1a8c3436ca809ee47507bed340ca1e3b67)`()` ||\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|\n| [OnAdClicked](#classfirebase_1_1gma_1_1_ad_listener_1a296c1936ddca41ceb2b1c25a1d5dd6f4)`()` | `virtual void` Called when a click is recorded for an ad. |\n| [OnAdClosed](#classfirebase_1_1gma_1_1_ad_listener_1a5790b7fe841a3cb3f4bb08fccbbe7b4f)`()` | `virtual void` Called when the user is about to return to the application after clicking on an ad. |\n| [OnAdImpression](#classfirebase_1_1gma_1_1_ad_listener_1aedd4596049834f274e9ff41186bb355d)`()` | `virtual void` Called when an impression is recorded for an ad. |\n| [OnAdOpened](#classfirebase_1_1gma_1_1_ad_listener_1a9c844476cb30f7c42a90b9f3ef073575)`()` | `virtual void` Called when an ad opens an overlay that covers the screen. |\n\nPublic functions\n----------------\n\n### OnAdClicked\n\n```c++\nvirtual void OnAdClicked()\n``` \nCalled when a click is recorded for an ad. \n\n### OnAdClosed\n\n```c++\nvirtual void OnAdClosed()\n``` \nCalled when the user is about to return to the application after clicking on an ad. \n\n### OnAdImpression\n\n```c++\nvirtual void OnAdImpression()\n``` \nCalled when an impression is recorded for an ad. \n\n### OnAdOpened\n\n```c++\nvirtual void OnAdOpened()\n``` \nCalled when an ad opens an overlay that covers the screen. \n\n### \\~AdListener\n\n```c++\nvirtual ~AdListener()\n```"]]