Stay organized with collections
Save and categorize content based on your preferences.
firebase::gma::AdResult
#include <types.h>
Information about the result of an ad operation.
Summary
Public functions
|
ad_error() const
|
An object representing an error which occurred during an ad operation.
|
is_successful() const
|
bool
Returns true if the operation was successful.
|
response_info() const
|
For debugging and logging purposes, successfully loaded ads provide a ResponseInfo object which contains information about the adapter which loaded the ad.
|
Public functions
AdResult
AdResult(
const AdError & ad_error
)
ad_error
const AdError & ad_error() const
An object representing an error which occurred during an ad operation.
If the AdResult::is_successful() returned true, then the AdError object returned via this method will contain no contextual information.
is_successful
bool is_successful() const
Returns true if the operation was successful.
response_info
const ResponseInfo & response_info() const
For debugging and logging purposes, successfully loaded ads provide a ResponseInfo object which contains information about the adapter which loaded the ad.
If the ad failed to load then the object returned from this method will have default values. Information about the error should be retrieved via AdResult::ad_error() instead.
~AdResult
virtual ~AdResult()
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::AdResult\u003c/code\u003e provides information about the outcome of an ad operation, indicating success or failure.\u003c/p\u003e\n"],["\u003cp\u003eIt includes an \u003ccode\u003eAdError\u003c/code\u003e object to detail any errors encountered during the ad operation.\u003c/p\u003e\n"],["\u003cp\u003eFor successful operations, a \u003ccode\u003eResponseInfo\u003c/code\u003e object offers insights into the ad loading process and the adapter used.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the \u003ccode\u003eis_successful()\u003c/code\u003e method to quickly check if the ad operation was completed without errors.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdResult\u003c/code\u003e objects are automatically managed with constructors and destructors, simplifying their use within the Firebase framework.\u003c/p\u003e\n"]]],["`AdResult` provides details about an ad operation's outcome. Key actions include constructing an `AdResult` with or without an `AdError`, and checking the operation's success via `is_successful()`. If successful, `response_info()` offers debugging data about the ad adapter. Conversely, `ad_error()` retrieves an error object if a failure occurred. The default constructor, destructor and a constructor taking an `AdError` are provided. `AdError` will contain no contextual info if operation was successful.\n"],null,["# firebase::gma::AdResult Class Reference\n\nfirebase::gma::AdResult\n=======================\n\n\n`#include \u003ctypes.h\u003e`\n\nInformation about the result of an ad operation.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AdResult](#classfirebase_1_1gma_1_1_ad_result_1ae5d776697d555aaa64ed4c7e70afbb44)`()` Default Constructor. ||\n| [AdResult](#classfirebase_1_1gma_1_1_ad_result_1a790bad9cea90e6f8b3496ab790dbf76a)`(const `[AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` & ad_error)` Constructor. ||\n| [~AdResult](#classfirebase_1_1gma_1_1_ad_result_1a96f534e1443b8d9bf840b85b7346cf7b)`()` Destructor. ||\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ad_error](#classfirebase_1_1gma_1_1_ad_result_1ae0f7473052558730cf60d068c4da8a36)`() const ` | `const `[AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` &` An object representing an error which occurred during an ad operation. |\n| [is_successful](#classfirebase_1_1gma_1_1_ad_result_1a2ff415649c22739dec4f7085fdcbd500)`() const ` | `bool` Returns true if the operation was successful. |\n| [response_info](#classfirebase_1_1gma_1_1_ad_result_1abcb41bd0d068577e7eac2fea26080a71)`() const ` | `const `[ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info)` &` For debugging and logging purposes, successfully loaded ads provide a [ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) object which contains information about the adapter which loaded the ad. |\n\nPublic functions\n----------------\n\n### AdResult\n\n```c++\n AdResult()\n``` \nDefault Constructor. \n\n### AdResult\n\n```c++\n AdResult(\n const AdError & ad_error\n)\n``` \nConstructor. \n\n### ad_error\n\n```c++\nconst AdError & ad_error() const \n``` \nAn object representing an error which occurred during an ad operation.\n\nIf the [AdResult::is_successful()](/admob/cpp/reference/class/firebase/gma/ad-result#classfirebase_1_1gma_1_1_ad_result_1a2ff415649c22739dec4f7085fdcbd500) returned true, then the [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) object returned via this method will contain no contextual information. \n\n### is_successful\n\n```c++\nbool is_successful() const \n``` \nReturns true if the operation was successful. \n\n### response_info\n\n```c++\nconst ResponseInfo & response_info() const \n``` \nFor debugging and logging purposes, successfully loaded ads provide a [ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) object which contains information about the adapter which loaded the ad.\n\nIf the ad failed to load then the object returned from this method will have default values. Information about the error should be retrieved via [AdResult::ad_error()](/admob/cpp/reference/class/firebase/gma/ad-result#classfirebase_1_1gma_1_1_ad_result_1ae0f7473052558730cf60d068c4da8a36) instead. \n\n### \\~AdResult\n\n```c++\nvirtual ~AdResult()\n``` \nDestructor."]]