Stay organized with collections
Save and categorize content based on your preferences.
firebase::gma::UserEarnedRewardListener
#include <types.h>
Listener to be invoked when the user earned a reward.
Summary
Public functions
OnUserEarnedReward
virtual void OnUserEarnedReward(
const AdReward & reward
)
Called when the user earned a reward.
The app is responsible for crediting the user with the reward.
Details |
Parameters |
reward
|
the AdReward that should be granted to the user.
|
|
~UserEarnedRewardListener
virtual ~UserEarnedRewardListener()
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\u003eUserEarnedRewardListener\u003c/code\u003e is a class that allows developers to get notified when a user earns a reward in their app.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOnUserEarnedReward\u003c/code\u003e function is called when a reward is earned and provides information about the reward through an \u003ccode\u003eAdReward\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eIt is the app developer's responsibility to handle the reward crediting process for the user when the \u003ccode\u003eOnUserEarnedReward\u003c/code\u003e function is triggered.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUserEarnedRewardListener\u003c/code\u003e has a virtual destructor \u003ccode\u003e~UserEarnedRewardListener()\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `UserEarnedRewardListener` class provides a mechanism for handling user rewards in an app. It has a destructor `~UserEarnedRewardListener` and one key function: `OnUserEarnedReward`. This function is triggered when a user earns a reward, passing an `AdReward` object. The app is responsible for giving this `AdReward` to the user. `OnUserEarnedReward` receives the `AdReward` object that is supposed to be given to the user.\n"],null,["# firebase::gma::UserEarnedRewardListener Class Reference\n\nfirebase::gma::UserEarnedRewardListener\n=======================================\n\n\n`#include \u003ctypes.h\u003e`\n\nListener to be invoked when the user earned a reward.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~UserEarnedRewardListener](#classfirebase_1_1gma_1_1_user_earned_reward_listener_1a6ae7895b293112acc3993d993f712f49)`()` ||\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| [OnUserEarnedReward](#classfirebase_1_1gma_1_1_user_earned_reward_listener_1a7f96cabdc5dacfd0d2f0b202a66c7b57)`(const `[AdReward](/admob/cpp/reference/class/firebase/gma/ad-reward#classfirebase_1_1gma_1_1_ad_reward)` & reward)` | `virtual void` Called when the user earned a reward. |\n\nPublic functions\n----------------\n\n### OnUserEarnedReward\n\n```c++\nvirtual void OnUserEarnedReward(\n const AdReward & reward\n)\n``` \nCalled when the user earned a reward.\n\nThe app is responsible for crediting the user with the reward.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------|------------------------------------------------------------------------------------------------------------------------------------------| | `reward` | the [AdReward](/admob/cpp/reference/class/firebase/gma/ad-reward#classfirebase_1_1gma_1_1_ad_reward) that should be granted to the user. | |\n\n### \\~UserEarnedRewardListener\n\n```c++\nvirtual ~UserEarnedRewardListener()\n```"]]