diff --git a/admob/src/include/firebase/admob.h b/admob/src/include/firebase/admob.h index 739402af5d..957c86b7e1 100644 --- a/admob/src/include/firebase/admob.h +++ b/admob/src/include/firebase/admob.h @@ -36,13 +36,25 @@ FIREBASE_APP_REGISTER_CALLBACKS_REFERENCE(admob) namespace firebase { +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// /// @brief API for AdMob with Firebase. /// /// The AdMob API allows you to load and display mobile ads using the Google /// Mobile Ads SDK. Each ad format has its own header file. namespace admob { -/// Initializes AdMob via Firebase. +/// @deprecated +/// @brief Initializes AdMob via Firebase. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. /// /// @param app The Firebase app for which to initialize mobile ads. /// @@ -50,9 +62,17 @@ namespace admob { /// kInitResultFailedMissingDependency on Android if Google Play services is not /// available on the current device and the Google Mobile Ads SDK requires /// Google Play services (for example, when using 'play-services-ads-lite'). -InitResult Initialize(const ::firebase::App& app); +FIREBASE_DEPRECATED InitResult Initialize(const ::firebase::App& app); -/// Initializes AdMob via Firebase with the publisher's AdMob app ID. +/// @deprecated +/// @brief Initializes AdMob via Firebase with the publisher's AdMob app ID. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// Initializing the Google Mobile Ads SDK with the AdMob app ID at app launch /// allows the SDK to fetch app-level settings and perform configuration tasks /// as early as possible. This can help reduce latency for the initial ad @@ -69,10 +89,18 @@ InitResult Initialize(const ::firebase::App& app); /// kInitResultFailedMissingDependency on Android if Google Play services is not /// available on the current device and the Google Mobile Ads SDK requires /// Google Play services (for example, when using 'play-services-ads-lite'). -InitResult Initialize(const ::firebase::App& app, const char* admob_app_id); +FIREBASE_DEPRECATED InitResult Initialize(const ::firebase::App& app, + const char* admob_app_id); #if FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN) -/// Initializes AdMob without Firebase for Android. +/// @deprecated +/// @brief Initializes AdMob without Firebase for Android. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. /// /// The arguments to @ref Initialize are platform-specific so the caller must do /// something like this: @@ -91,9 +119,17 @@ InitResult Initialize(const ::firebase::App& app, const char* admob_app_id); /// kInitResultFailedMissingDependency on Android if Google Play services is not /// available on the current device and the AdMob SDK requires /// Google Play services (for example when using 'play-services-ads-lite'). -InitResult Initialize(JNIEnv* jni_env, jobject activity); +FIREBASE_DEPRECATED InitResult Initialize(JNIEnv* jni_env, jobject activity); -/// Initializes AdMob via Firebase with the publisher's AdMob app ID. +/// @deprecated +/// @brief Initializes AdMob via Firebase with the publisher's AdMob app ID. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// Initializing the Google Mobile Ads SDK with the AdMob app ID at app launch /// allows the SDK to fetch app-level settings and perform configuration tasks /// as early as possible. This can help reduce latency for the initial ad @@ -121,15 +157,30 @@ InitResult Initialize(JNIEnv* jni_env, jobject activity); /// kInitResultFailedMissingDependency on Android if Google Play services is not /// available on the current device and the AdMob SDK requires /// Google Play services (for example when using 'play-services-ads-lite'). -InitResult Initialize(JNIEnv* jni_env, jobject activity, - const char* admob_app_id); +FIREBASE_DEPRECATED InitResult Initialize(JNIEnv* jni_env, jobject activity, + const char* admob_app_id); #endif // defined(__ANDROID__) || defined(DOXYGEN) #if !FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN) -/// Initializes AdMob without Firebase for iOS. -InitResult Initialize(); +/// @deprecated +/// @brief Initializes AdMob without Firebase for iOS. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED InitResult Initialize(); -/// Initializes AdMob with the publisher's AdMob app ID and without Firebase for -/// iOS. +/// @deprecated +/// @brief Initializes AdMob with the publisher's AdMob app ID and without +/// Firebase for iOS. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// Initializing the Google Mobile Ads SDK with the AdMob app ID at app launch /// allows the SDK to fetch app-level settings and perform configuration tasks /// as early as possible. This can help reduce latency for the initial ad @@ -142,14 +193,21 @@ InitResult Initialize(); /// @param[in] admob_app_id The publisher's AdMob app ID. /// /// @return kInitResultSuccess if initialization succeeded -InitResult Initialize(const char* admob_app_id); +FIREBASE_DEPRECATED InitResult Initialize(const char* admob_app_id); #endif // !defined(__ANDROID__) || defined(DOXYGEN) +/// @deprecated /// @brief Terminate AdMob. /// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// Frees resources associated with AdMob that were allocated during /// @ref firebase::admob::Initialize(). -void Terminate(); +FIREBASE_DEPRECATED void Terminate(); } // namespace admob } // namespace firebase diff --git a/admob/src/include/firebase/admob/banner_view.h b/admob/src/include/firebase/admob/banner_view.h index 3bfc7080f6..2d691f2d3a 100644 --- a/admob/src/include/firebase/admob/banner_view.h +++ b/admob/src/include/firebase/admob/banner_view.h @@ -29,6 +29,11 @@ namespace internal { class BannerViewInternal; } // namespace internal +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// /// @brief Loads and displays AdMob banner ads. /// /// Each BannerView object corresponds to a single AdMob banner placement. There @@ -68,12 +73,20 @@ class BannerViewInternal; /// banner_view->LoadAd(your_ad_request); /// } /// @endcode +/// class BannerView { public: #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL - /// The presentation state of a @ref BannerView. + /// @deprecated + /// @brief The presentation state of a @ref BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. enum PresentationState { /// BannerView is currently hidden. kPresentationStateHidden = 0, @@ -95,7 +108,14 @@ class BannerView { #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL - /// The possible screen positions for a @ref BannerView. + /// @deprecated + /// @brief The possible screen positions for a @ref BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. enum Position { /// Top of the screen, horizontally centered. kPositionTop = 0, @@ -114,19 +134,40 @@ class BannerView { // LINT.ThenChange(//depot_firebase_cpp/admob/client/cpp/src_java/com/google/firebase/admob/internal/cpp/ConstantsHelper.java) #endif // INTERNAL_EXPERIMENTAL - /// A listener class that developers can extend and pass to a @ref BannerView - /// object's @ref SetListener method to be notified of changes to the - /// presentation state and bounding box. + /// @deprecated + /// @brief A listener class that developers can extend and pass to a @ref + /// BannerView object's @ref SetListener method to be notified of changes to + /// the presentation state and bounding box. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. class Listener { public: - /// This method is called when the @ref BannerView object's presentation - /// state changes. + /// @deprecated + /// @brief This method is called when the @ref BannerView object's + /// presentation state changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] banner_view The banner view whose presentation state changed. /// @param[in] state The new presentation state. virtual void OnPresentationStateChanged(BannerView* banner_view, PresentationState state) = 0; - /// This method is called when the @ref BannerView object's bounding box - /// changes. + /// @deprecated + /// @brief This method is called when the @ref BannerView object's bounding + /// box changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] banner_view The banner view whose bounding box changed. /// @param[in] box The new bounding box. virtual void OnBoundingBoxChanged(BannerView* banner_view, @@ -134,101 +175,245 @@ class BannerView { virtual ~Listener(); }; - /// Creates an uninitialized @ref BannerView object. + /// @deprecated + /// @brief Creates an uninitialized @ref BannerView object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + /// /// @ref Initialize must be called before the object is used. - BannerView(); + FIREBASE_DEPRECATED BannerView(); ~BannerView(); - /// Initializes the @ref BannerView object. + /// @deprecated + /// @brief Initializes the @ref BannerView object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] parent The platform-specific UI element that will host the ad. /// @param[in] ad_unit_id The ad unit ID to use when requesting ads. /// @param[in] size The desired ad size for the banner. - Future Initialize(AdParent parent, const char* ad_unit_id, AdSize size); + FIREBASE_DEPRECATED Future Initialize(AdParent parent, + const char* ad_unit_id, + AdSize size); - /// Returns a @ref Future that has the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future that has the status of the last call to /// @ref Initialize. - Future InitializeLastResult() const; - - /// Begins an asynchronous request for an ad. If successful, the ad will - /// automatically be displayed in the BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future InitializeLastResult() const; + + /// @deprecated + /// @brief Begins an asynchronous request for an ad. If successful, the ad + /// will automatically be displayed in the BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] request An AdRequest struct with information about the request /// to be made (such as targeting info). - Future LoadAd(const AdRequest& request); + FIREBASE_DEPRECATED Future LoadAd(const AdRequest& request); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref LoadAd. - Future LoadAdLastResult() const; - - /// Hides the BannerView. - Future Hide(); - - /// Returns a @ref Future containing the status of the last call to + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future LoadAdLastResult() const; + + /// @deprecated + /// @brief Hides the BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Hide(); + + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Hide. - Future HideLastResult() const; - - /// Shows the @ref BannerView. - Future Show(); - - /// Returns a @ref Future containing the status of the last call to + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future HideLastResult() const; + + /// @deprecated + /// @brief Shows the @ref BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Show(); + + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Show. - Future ShowLastResult() const; - - /// Pauses the @ref BannerView. Should be called whenever the C++ engine - /// pauses or the application loses focus. - Future Pause(); - - /// Returns a @ref Future containing the status of the last call to + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future ShowLastResult() const; + + /// @deprecated + /// @brief Pauses the @ref BannerView. Should be called whenever the C++ + /// engine pauses or the application loses focus. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Pause(); + + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Pause. - Future PauseLastResult() const; - - /// Resumes the @ref BannerView after pausing. - Future Resume(); - - /// Returns a @ref Future containing the status of the last call to + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future PauseLastResult() const; + + /// @deprecated + /// @brief Resumes the @ref BannerView after pausing. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Resume(); + + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Resume. - Future ResumeLastResult() const; - - /// Cleans up and deallocates any resources used by the @ref BannerView. - Future Destroy(); - - /// Returns a @ref Future containing the status of the last call to + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future ResumeLastResult() const; + + /// @deprecated + /// @brief Cleans up and deallocates any resources used by the @ref + /// BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Destroy(); + + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Destroy. - Future DestroyLastResult() const; - - /// Moves the @ref BannerView so that its top-left corner is located at + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future DestroyLastResult() const; + + /// @deprecated + /// @brief Moves the @ref BannerView so that its top-left corner is located at /// (x, y). Coordinates are in pixels from the top-left corner of the screen. /// - /// When built for Android, the library will not display an ad on top of or - /// beneath an Activity's status bar. If a call to MoveTo would result in an - /// overlap, the @ref BannerView is placed just below the status bar, so no - /// overlap occurs. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] x The desired horizontal coordinate. /// @param[in] y The desired vertical coordinate. - Future MoveTo(int x, int y); + FIREBASE_DEPRECATED Future MoveTo(int x, int y); - /// Moves the @ref BannerView so that it's located at the given pre-defined - /// position. + /// @deprecated + /// @brief Moves the @ref BannerView so that it's located at the given + /// pre-defined position. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] position The pre-defined position to which to move the /// @ref BannerView. - Future MoveTo(Position position); - - /// Returns a @ref Future containing the status of the last call to either - /// version of @ref MoveTo. - Future MoveToLastResult() const; + FIREBASE_DEPRECATED Future MoveTo(Position position); - /// Returns the current presentation state of the @ref BannerView. + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to + /// either version of @ref MoveTo. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future MoveToLastResult() const; + + /// @deprecated + /// @brief Returns the current presentation state of the @ref BannerView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @return The current presentation state. - PresentationState presentation_state() const; - - /// Retrieves the @ref BannerView's current onscreen size and location. - /// @return The current size and location. Values are in pixels, and location - /// coordinates originate from the top-left corner of the screen. - BoundingBox bounding_box() const; + FIREBASE_DEPRECATED PresentationState presentation_state() const; - /// Sets the @ref Listener for this object. + /// @deprecated + /// @brief Retrieves the @ref BannerView's current onscreen size and location. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED BoundingBox bounding_box() const; + + /// @deprecated + /// @brief Sets the @ref Listener for this object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] listener A valid BannerView::Listener to receive callbacks. - void SetListener(Listener* listener); + FIREBASE_DEPRECATED void SetListener(Listener* listener); private: // An internal, platform-specific implementation object that this class uses diff --git a/admob/src/include/firebase/admob/interstitial_ad.h b/admob/src/include/firebase/admob/interstitial_ad.h index 6e280eec88..b201ab7c34 100644 --- a/admob/src/include/firebase/admob/interstitial_ad.h +++ b/admob/src/include/firebase/admob/interstitial_ad.h @@ -29,6 +29,11 @@ namespace internal { class InterstitialAdInternal; } // namespace internal +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// /// @brief Loads and displays AdMob interstitial ads. /// /// @ref InterstitialAd is a single-use object that can load and show a @@ -74,12 +79,20 @@ class InterstitialAdInternal; /// interstitial->Show(); /// } /// @endcode +/// class InterstitialAd { public: #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL - /// The presentation states of an @ref InterstitialAd. + /// @deprecated + /// @brief The presentation states of an @ref InterstitialAd. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. enum PresentationState { /// InterstitialAd is not currently being shown. kPresentationStateHidden = 0, @@ -92,14 +105,31 @@ class InterstitialAd { // LINT.ThenChange(//depot_firebase_cpp/admob/client/cpp/src_java/com/google/firebase/admob/internal/cpp/InterstitialAdHelper.java) #endif // INTERNAL_EXPERIMENTAL - /// A listener class that developers can extend and pass to an + /// @deprecated + /// @brief A listener class that developers can extend and pass to an /// @ref InterstitialAd object's @ref SetListener method to be notified of - /// presentation state changes. This is useful for changes caused by user - /// interaction, such as when the user closes an interstitial. + /// presentation state changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] interstitial_ad The interstitial ad whose presentation state /// changed. /// @param[in] state The new presentation state. @@ -108,48 +138,114 @@ class InterstitialAd { virtual ~Listener(); }; - /// Creates an uninitialized @ref InterstitialAd object. + /// @deprecated + /// @brief Creates an uninitialized @ref InterstitialAd object. /// @ref Initialize must be called before the object is used. - InterstitialAd(); + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED InterstitialAd(); ~InterstitialAd(); - /// Initialize the @ref InterstitialAd object. + /// @deprecated + /// @brief Initialize the @ref InterstitialAd object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] parent The platform-specific UI element that will host the ad. /// @param[in] ad_unit_id The ad unit ID to use in loading the ad. - Future Initialize(AdParent parent, const char* ad_unit_id); + FIREBASE_DEPRECATED Future Initialize(AdParent parent, + const char* ad_unit_id); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Initialize. - Future InitializeLastResult() const; + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future InitializeLastResult() const; - /// Begins an asynchronous request for an ad. The - /// @ref InterstitialAd::presentation_state method can be used to track the - /// progress of the request. + /// @deprecated + /// @brief Begins an asynchronous request for an ad. + /// + /// The @ref InterstitialAd::presentation_state method can be used to track + /// the progress of the request. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] request An AdRequest struct with information about the request /// to be made (such as targeting info). - Future LoadAd(const AdRequest& request); + FIREBASE_DEPRECATED Future LoadAd(const AdRequest& request); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref LoadAd. - Future LoadAdLastResult() const; + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future LoadAdLastResult() const; - /// Shows the @ref InterstitialAd. This should not be called unless an ad has - /// already been loaded. - Future Show(); + /// @deprecated + /// @brief Shows the @ref InterstitialAd. This should not be called unless an + /// ad has already been loaded. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future Show(); - /// Returns a @ref Future containing the status of the last call to @ref Show. - Future ShowLastResult() const; + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to + /// @ref Show. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future ShowLastResult() const; - /// Returns the current presentation state of the @ref InterstitialAd. + /// @deprecated + /// @brief Returns the current presentation state of the @ref InterstitialAd. /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @return The current presentation state. - PresentationState presentation_state() const; + FIREBASE_DEPRECATED PresentationState presentation_state() const; - /// Sets the @ref Listener for this @ref InterstitialAd. + /// @deprecated + /// @brief Sets the @ref Listener for this @ref InterstitialAd. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] listener A valid InterstititalAd::Listener to receive /// callbacks. - void SetListener(Listener* listener); + FIREBASE_DEPRECATED void SetListener(Listener* listener); private: // An internal, platform-specific implementation object that this class uses diff --git a/admob/src/include/firebase/admob/native_express_ad_view.h b/admob/src/include/firebase/admob/native_express_ad_view.h index 416aebf276..7e57196782 100644 --- a/admob/src/include/firebase/admob/native_express_ad_view.h +++ b/admob/src/include/firebase/admob/native_express_ad_view.h @@ -29,6 +29,12 @@ namespace internal { class NativeExpressAdViewInternal; } // namespace internal +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// Native Express Ads has been discontinued, and are no longer served. +/// /// @brief Loads and displays ads from AdMob Native Ads Express. /// /// Each NativeExpressAdView object corresponds to a single AdMob Native Express @@ -68,15 +74,19 @@ class NativeExpressAdViewInternal; /// ad_view->LoadAd(your_ad_request); /// } /// @endcode -/// -/// @deprecated This class will be removed in a future version. -/// Native Express Ads has been discontinued, and are no longer served. class NativeExpressAdView { public: #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL - /// The presentation state of a @ref NativeExpressAdView. + /// @deprecated + /// @brief The presentation state of a @ref NativeExpressAdView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. enum PresentationState { /// NativeExpressAdView is currently hidden. kPresentationStateHidden = 0, @@ -99,7 +109,14 @@ class NativeExpressAdView { #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL - /// The possible screen positions for a @ref NativeExpressAdView. + /// @deprecated + /// @brief The possible screen positions for a @ref NativeExpressAdView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. enum Position { /// Top of the screen, horizontally centered. kPositionTop = 0, @@ -118,140 +135,234 @@ class NativeExpressAdView { // LINT.ThenChange(//depot_firebase_cpp/admob/client/cpp/src_java/com/google/firebase/admob/internal/cpp/ConstantsHelper.java) #endif // INTERNAL_EXPERIMENTAL - /// A listener class that developers can extend and pass to a + /// @deprecated + /// @brief A listener class that developers can extend and pass to a /// @ref NativeExpressAdView object's @ref SetListener method to be notified /// of changes to the presentation state and bounding box. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. class Listener { public: - /// This method is called when the @ref NativeExpressAdView object's + /// @deprecated + /// @brief This method is called when the @ref NativeExpressAdView object's /// presentation state changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] ad_view The native express ad view whose presentation state /// changed. /// @param[in] state The new presentation state. - virtual void OnPresentationStateChanged(NativeExpressAdView* ad_view, - PresentationState state) = 0; - /// This method is called when the @ref NativeExpressAdView object's + FIREBASE_DEPRECATED virtual void OnPresentationStateChanged( + NativeExpressAdView* ad_view, PresentationState state) = 0; + + /// @deprecated + /// @brief This method is called when the @ref NativeExpressAdView object's /// bounding box changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + /// + /// @ref Initialize must be called before the object is used. FIREBASE_DEPRECATED NativeExpressAdView(); - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. - FIREBASE_DEPRECATED ~NativeExpressAdView(); + ~NativeExpressAdView(); - /// Initializes the @ref NativeExpressAdView object. + /// @deprecated + /// @brief Initializes the @ref NativeExpressAdView object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] parent The platform-specific UI element that will host the ad. /// @param[in] ad_unit_id The ad unit ID to use when requesting ads. /// @param[in] size The desired ad size for the native express ad. - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED Future Initialize(AdParent parent, const char* ad_unit_id, AdSize size); - /// Returns a @ref Future that has the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future that has the status of the last call to /// @ref Initialize. - Future InitializeLastResult() const; - - /// Begins an asynchronous request for an ad. If successful, the ad will - /// automatically be displayed in the NativeExpressAdView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED Future InitializeLastResult() const; + + /// @deprecated + /// @brief Begins an asynchronous request for an ad. If successful, the ad + /// will automatically be displayed in the NativeExpressAdView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] request An AdRequest struct with information about the request /// to be made (such as targeting info). - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED Future LoadAd(const AdRequest& request); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref LoadAd. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future LoadAdLastResult() const; - /// Hides the NativeExpressAdView. + /// @deprecated + /// @brief Hides the NativeExpressAdView. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future Hide(); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Hide. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future HideLastResult() const; - /// Shows the @ref NativeExpressAdView. + /// @deprecated + /// @brief Shows the @ref NativeExpressAdView. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future Show(); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Show. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future ShowLastResult() const; - /// Pauses the @ref NativeExpressAdView. Should be called whenever the C++ - /// engine pauses or the application loses focus. + /// @deprecated + /// @brief Pauses the @ref NativeExpressAdView. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// Should be called whenever the C++ engine pauses or the application loses + /// focus. FIREBASE_DEPRECATED Future Pause(); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Pause. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future PauseLastResult() const; - /// Resumes the @ref NativeExpressAdView after pausing. + /// @deprecated + /// @brief Resumes the @ref NativeExpressAdView after pausing. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future Resume(); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Resume. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future ResumeLastResult() const; - /// Cleans up and deallocates any resources used by the + /// @deprecated + /// @brief Cleans up and deallocates any resources used by the /// @ref NativeExpressAdView. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future Destroy(); - /// Returns a @ref Future containing the status of the last call to + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to /// @ref Destroy. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future DestroyLastResult() const; - /// Moves the @ref NativeExpressAdView so that its top-left corner is located - /// at (x, y). Coordinates are in pixels from the top-left corner of the - /// screen. + /// @deprecated + /// @brief Moves the @ref NativeExpressAdView so that its top-left corner is + /// located at (x, y). Coordinates are in pixels from the top-left corner of + /// the screen. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// /// When built for Android, the library will not display an ad on top of or /// beneath an Activity's status bar. If a call to MoveTo would result in an @@ -259,49 +370,68 @@ class NativeExpressAdView { /// so no overlap occurs. /// @param[in] x The desired horizontal coordinate. /// @param[in] y The desired vertical coordinate. - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED Future MoveTo(int x, int y); - /// Moves the @ref NativeExpressAdView so that it's located at the given - /// pre-defined position. + /// @deprecated + /// @brief Moves the @ref NativeExpressAdView so that it's located at the + /// given pre-defined position. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] position The pre-defined position to which to move the /// @ref NativeExpressAdView. - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED Future MoveTo(Position position); - /// Returns a @ref Future containing the status of the last call to either - /// version of @ref MoveTo. + /// @deprecated + /// @brief Returns a @ref Future containing the status of the last call to + /// either version of @ref MoveTo. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. FIREBASE_DEPRECATED Future MoveToLastResult() const; - /// Returns the current presentation state of the @ref NativeExpressAdView. - /// @return The current presentation state. + /// @deprecated + /// @brief Returns the current presentation state of the + /// @ref NativeExpressAdView. /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + /// @return The current presentation state. FIREBASE_DEPRECATED PresentationState GetPresentationState() const; - /// Retrieves the @ref NativeExpressAdView's current onscreen size and + /// @deprecated + /// @brief Retrieves the @ref NativeExpressAdView's current onscreen size and /// location. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @return The current size and location. Values are in pixels, and location /// coordinates originate from the top-left corner of the screen. - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED BoundingBox GetBoundingBox() const; - /// Sets the @ref Listener for this object. + /// @deprecated + /// @brief Sets the @ref Listener for this object. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] listener A valid NativeExpressAdView::Listener to receive /// callbacks. - /// - /// @deprecated This class will be removed in a future version. - /// Native Express Ads has been discontinued, and are no longer served. FIREBASE_DEPRECATED void SetListener(Listener* listener); private: diff --git a/admob/src/include/firebase/admob/rewarded_video.h b/admob/src/include/firebase/admob/rewarded_video.h index ac77c19dc1..32bea80b55 100644 --- a/admob/src/include/firebase/admob/rewarded_video.h +++ b/admob/src/include/firebase/admob/rewarded_video.h @@ -30,6 +30,11 @@ class Mutex; namespace admob { +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// /// @brief Loads and displays rewarded video ads via AdMob mediation. /// /// The rewarded_video namespace contains methods to load and display rewarded @@ -91,11 +96,17 @@ namespace admob { /// } /// @endcode namespace rewarded_video { - #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL -/// The possible presentation states for rewarded video. +/// @deprecated +/// @brief The possible presentation states for rewarded video. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. enum PresentationState { /// No ad is currently being shown. kPresentationStateHidden = 0, @@ -114,8 +125,15 @@ enum PresentationState { // LINT.ThenChange(//depot_firebase_cpp/admob/client/cpp/src_java/com/google/firebase/admob/internal/cpp/RewardedVideoHelper.java) #endif // INTERNAL_EXPERIMENTAL +/// @deprecated /// @brief A reward to be given to the user in exchange for watching a rewarded /// video ad. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. struct RewardItem { /// The reward amount. float amount; @@ -123,40 +141,104 @@ struct RewardItem { std::string reward_type; }; -/// A listener class that developers can extend and pass to @ref SetListener -/// to be notified of rewards and changes to the presentation state. +/// @deprecated +/// @brief A listener class that developers can extend and pass to @ref +/// SetListener to be notified of rewards and changes to the presentation state. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. class Listener { public: - /// Invoked when the user should be given a reward for watching an ad. + /// @deprecated + /// @brief Invoked when the user should be given a reward for watching an ad. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] reward The user's reward. - virtual void OnRewarded(RewardItem reward) = 0; + FIREBASE_DEPRECATED virtual void OnRewarded(RewardItem reward) = 0; - /// Invoked when the presentation state of the ad changes. + /// @deprecated + /// @brief Invoked when the presentation state of the ad changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. /// @param[in] state The new presentation state. - virtual void OnPresentationStateChanged(PresentationState state) = 0; + FIREBASE_DEPRECATED virtual void OnPresentationStateChanged( + PresentationState state) = 0; virtual ~Listener(); }; -/// A polling-based listener that developers can instantiate and pass to +/// @deprecated +/// @brief A polling-based listener that developers can instantiate and pass to /// @ref SetListener in order to queue rewards for later retrieval. /// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// The @ref PollReward method should be used to retrieve awards granted by the /// Mobile Ads SDK and queued by this class. /// @ref rewarded_video::presentation_state can be used to poll the current /// presentation state, so no additional method has been added for it. class PollableRewardListener : public Listener { public: - PollableRewardListener(); + /// @deprecated + /// @brief Default constructor. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED PollableRewardListener(); ~PollableRewardListener(); - void OnRewarded(RewardItem reward); - void OnPresentationStateChanged(PresentationState state); - /// Pop the oldest queued reward, and copy its data into the provided - /// RewardItem. If no reward is available, the struct is unchanged. + /// @deprecated + /// @brief Invoked when the user should be given a reward for watching an ad. + /// + /// Deprecated. The functionality in the firebase::admob + /// namespace has been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the new + /// SDK in our migration + /// guide. + FIREBASE_DEPRECATED void OnRewarded(RewardItem reward); + + /// @deprecated + /// @brief nvoked when the presentation state of the ad changes. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + FIREBASE_DEPRECATED void OnPresentationStateChanged(PresentationState state); + + /// @deprecated + /// @brief Pop the oldest queued reward, and copy its data into the provided + /// RewardItem. + /// + /// The functionality in the firebase::admob namespace has + /// been replaced by the Google Mobile Ads SDK in the + /// firebase::gma namespace. Learn how to transition to the + /// new SDK in our migration + /// guide. + /// + /// If no reward is available, the struct is unchanged. /// @param reward Pointer to a struct that reward data can be copied into. /// @returns true if a reward was popped and data was copied, false otherwise. - bool PollReward(RewardItem* reward); + FIREBASE_DEPRECATED bool PollReward(RewardItem* reward); private: Mutex* mutex_; @@ -165,63 +247,158 @@ class PollableRewardListener : public Listener { std::queue rewards_; }; -/// Initializes rewarded video. This must be the first method invoked in +/// @deprecated +/// @brief Initializes rewarded video. This must be the first method invoked in /// this namespace. -Future Initialize(); +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future Initialize(); -/// Returns a @ref Future that has the status of the last call to +/// @deprecated +/// @brief Returns a @ref Future that has the status of the last call to /// @ref Initialize. -Future InitializeLastResult(); +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future InitializeLastResult(); -/// Begins an asynchronous request for an ad. +/// @deprecated +/// @brief Begins an asynchronous request for an ad. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. /// @param[in] ad_unit_id The ad unit ID to use in the request. /// @param[in] request An AdRequest struct with information about the request /// to be made (such as targeting info). -Future LoadAd(const char* ad_unit_id, const AdRequest& request); +FIREBASE_DEPRECATED Future LoadAd(const char* ad_unit_id, + const AdRequest& request); -/// Returns a @ref Future containing the status of the last call to +/// @deprecated +/// @brief Returns a @ref Future containing the status of the last call to /// @ref LoadAd. -Future LoadAdLastResult(); +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future LoadAdLastResult(); -/// Shows an ad, assuming one has loaded. @ref LoadAd must be called before this -/// method. +/// @deprecated +/// @brief Shows an ad, assuming one has loaded. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// +/// @ref LoadAd must be called before this method. /// @param[in] parent An @ref AdParent that is a reference to an iOS /// UIView or an Android Activity. -Future Show(AdParent parent); +FIREBASE_DEPRECATED Future Show(AdParent parent); -/// Returns a @ref Future containing the status of the last call to +/// @deprecated +/// @brief Returns a @ref Future containing the status of the last call to /// @ref Show. -Future ShowLastResult(); +/// +/// Deprecated. The functionality in the firebase::admob +/// namespace has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future ShowLastResult(); -/// Pauses any background processing associated with rewarded video. Should -/// be called whenever the C++ engine pauses or the application loses focus. -Future Pause(); +/// @deprecated +/// @brief Pauses any background processing associated with rewarded video. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// +/// Should be called whenever the C++ engine pauses or the application loses +/// focus. +FIREBASE_DEPRECATED Future Pause(); -/// Returns a @ref Future containing the status of the last call to +/// @deprecated +/// @brief Returns a @ref Future containing the status of the last call to /// @ref Pause. -Future PauseLastResult(); +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future PauseLastResult(); -/// Resumes the rewarded video system after pausing. -Future Resume(); +/// @deprecated +/// @brief Resumes the rewarded video system after pausing. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future Resume(); -/// Returns a @ref Future containing the status of the last call to +/// @deprecated +/// @brief Returns a @ref Future containing the status of the last call to /// @ref Resume. -Future ResumeLastResult(); +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +FIREBASE_DEPRECATED Future ResumeLastResult(); -/// Cleans up and deallocates any resources used by rewarded video. +/// @deprecated +/// @brief Cleans up and deallocates any resources used by rewarded video. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. +/// /// No other methods in rewarded_video should be called once this method has /// been invoked. The system is closed for business at that point. -void Destroy(); +FIREBASE_DEPRECATED void Destroy(); -/// Returns the current presentation state, indicating if an ad is visible or -/// if a video has started playing. +/// @deprecated +/// @brief Returns the current presentation state, indicating if an ad is +/// visible or if a video has started playing. /// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. /// @return The current presentation state. -PresentationState presentation_state(); +FIREBASE_DEPRECATED PresentationState presentation_state(); -/// Sets the @ref Listener that should receive callbacks. +/// @deprecated +/// @brief Sets the @ref Listener that should receive callbacks. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. /// @param[in] listener A valid Listener. -void SetListener(Listener* listener); +FIREBASE_DEPRECATED void SetListener(Listener* listener); } // namespace rewarded_video } // namespace admob diff --git a/admob/src/include/firebase/admob/types.h b/admob/src/include/firebase/admob/types.h index c6cd485edd..21a8379f2d 100644 --- a/admob/src/include/firebase/admob/types.h +++ b/admob/src/include/firebase/admob/types.h @@ -31,13 +31,20 @@ extern "C" { namespace firebase { namespace admob { -/// This is a platform specific datatype that is required to create an AdMob ad. +/// @deprecated The functionality in the firebase::admob namespace +/// has been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the new +/// SDK in our migration guide. +/// +/// @brief This is a platform specific datatype that is required to create an +/// AdMob ad. /// /// The following defines the datatype on each platform: ///
    ///
  • Android: A `jobject` which references an Android Activity.
  • ///
  • iOS: An `id` which references an iOS UIView.
  • ///
+/// #if FIREBASE_PLATFORM_ANDROID /// An Android Activity from Java. typedef jobject AdParent; @@ -53,7 +60,14 @@ typedef void *AdParent; #ifdef INTERNAL_EXPERIMENTAL // LINT.IfChange #endif // INTERNAL_EXPERIMENTAL -/// Error codes returned by Future::error(). +/// @deprecated +/// @brief Error codes returned by Future::error(). +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. enum AdMobError { /// Call completed successfully. kAdMobErrorNone, @@ -81,10 +95,24 @@ enum AdMobError { // LINT.ThenChange(//depot_firebase_cpp/admob/client/cpp/src_java/com/google/firebase/admob/internal/cpp/ConstantsHelper.java) #endif // INTERNAL_EXPERIMENTAL +/// @deprecated /// @brief Types of ad sizes. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. enum AdSizeType { kAdSizeStandard = 0 }; +/// @deprecated /// @brief An ad size value to be used in requesting ads. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. struct AdSize { /// The type of ad size. AdSizeType ad_size_type; @@ -94,10 +122,18 @@ struct AdSize { int width; }; +/// @deprecated /// @brief Gender information used as part of the /// @ref firebase::admob::AdRequest struct. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. enum Gender { - /// The gender of the current user is unknown or unspecified by the publisher. + /// The gender of the current user is unknown or unspecified by the + /// publisher. kGenderUnknown = 0, /// The current user is known to be male. kGenderMale, @@ -105,8 +141,15 @@ enum Gender { kGenderFemale }; +/// @deprecated /// @brief Indicates whether an ad request is considered tagged for /// child-directed treatment. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. enum ChildDirectedTreatmentState { /// The child-directed status for the request is not indicated. kChildDirectedTreatmentStateUnknown = 0, @@ -116,8 +159,15 @@ enum ChildDirectedTreatmentState { kChildDirectedTreatmentStateNotTagged }; +/// @deprecated /// @brief Generic Key-Value container used for the "extras" values in an /// @ref firebase::admob::AdRequest. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. struct KeyValuePair { /// The name for an "extra." const char *key; @@ -125,7 +175,14 @@ struct KeyValuePair { const char *value; }; +/// @deprecated /// @brief The information needed to request an ad. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. struct AdRequest { /// An array of test device IDs specifying devices that test ads will be /// returned for. @@ -159,8 +216,15 @@ struct AdRequest { ChildDirectedTreatmentState tagged_for_child_directed_treatment; }; +/// @deprecated /// @brief The screen location and dimensions of an ad view once it has been /// initialized. +/// +/// The functionality in the firebase::admob namespace has +/// been replaced by the Google Mobile Ads SDK in the +/// firebase::gma namespace. Learn how to transition to the +/// new SDK in our migration +/// guide. struct BoundingBox { /// Default constructor which initializes all member variables to 0. BoundingBox() : height(0), width(0), x(0), y(0) {} diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 3612c95164..1c185b5ccd 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -613,6 +613,9 @@ code. ## Release Notes ### Upcoming Release - Changes + - AdMob: The AdMob SDK has been deprecated. Please update your app to + use the new Google Mobile Ads SDK which facilitates similar + functionality. - General (Android): Switched over to Android BoM (Bill of Materials) for dependency versions. This requires Gradle 5. - Database (Desktop): If the app data directory doesn't exist, create it.