play-services-ads-lite
is moving to a reduced release cadence, and is not distributed with this release. For more information, see the Lite SDK documentation.AppOpenAd
orientation APIs.SearchAdView
and DynamicHeightSearchAdRequest
classes.MediationRewardedAdCallback.onUserEarnedReward()
and deprecated MediationRewardedAdCallback.onUserEarnedReward(RewardItem)
. Mediation adapters should update to use the new method.android.adservices.AD_SERVICES_CONFIG
property tag from the SDK’s manifest file to prevent merge conflicts for apps that Configure API-specific Ad Services.AdSize.getCurrentOrientationInterscrollerAdSize()
.ad failed to load
in the failure's stack trace. The stack trace logs this message as an error, but doesn't imply a crash. Consult Debug common error logging messages to interpret common ad loading failures. If you see a recurring error related to ad serving that’s not documented, share the stack trace with Mobile Ads SDK support.addCustomTargeting()
methods to AdRequest
.AdView.isCollapsible()
to indicate whether the last loaded banner is collapsible.compileSdkVersion
of 34.loadNativeAd
and loadRtbNativeAd()
in favor of loadNativeAdMapper()
and loadRtbNativeAdMapper()
. Adapters should migrate to using these new load methods and related objects.MobileAds.enableSameAppKey()
API and updated the alternative method MobileAds.putPublisherFirstPartyIdEnabled()
to return a boolean about whether the control persistence is successful or not.Native Ads
:
AdLoader.forUnifiedNativeAd()
. Use AdLoader.forNativeAd()
instead.AdLoader.forCustomTemplateAd()
. Use AdLoader.forCustomFormatAd()
instead.AdFormat.UNKNOWN
with no replacement. Apps using QueryInfo.generate()
must pass an ad format.AdManagerAdRequest.Builder
methods inherited from its parent can now be chained together to build an object from a single call. This required a change in the inheritance structure such that AdManagerAdRequest.Builder
no longer inherits from AdRequest.Builder
.MobileAds.setSameAppKeyEnabled()
and renamed the method to MobileAds.putPublisherFirstPartyIdEnabled()
.AdFormat.UNKNOWN
with no replacement. Apps using QueryInfo.generate()
must pass an ad format.setPublisherPrivacyPersonalizationState()
method for the Publisher Privacy Treatment API (Beta).compileSdkVersion
of 33
.QueryInfo.generate()
method that takes an ad unit ID.AdSize.FULL_WIDTH
as the width. Previously, ad sizes created using AdSize.FULL_WIDTH
would be treated as AdSize.SMART_BANNER
.AdRequest.Builder.addCustomEventExtrasBundle()
. Extend Adapter and interact with the extra parameters through AdRequest.Builder.addNetworkExtrasBundle()
instead.AdRequest.getCustomEventExtrasBundle()
. Extend Adapter and interact with the extra parameters through AdRequest.getNetworkExtrasBundle()
instead.NativeCustomFormatAd.getVideoController()
and NativeCustomFormatAd.getVideoMediaView()
in favor of NativeCustomFormatAd.getMediaContent()
.MobileAds.getVersionString()
in favor of MobileAds.getVersion()
.AdRequest.Builder.setAdInfo()
in favor of AdRequest.Builder.setAdString()
.AdManager.Builder.setAdString()
now returns an AdRequest.Builder
type.MediationRewardedVideoAdAdapter
and associated APIs in favor of Adapter
.AdRequest.getRequestAgent()
.Adapter.getVersionInfo()
and Adapter.getSDKVersionInfo()
changed from type com.google.android.gms.ads.mediation.VersionInfo
to com.google.android.gms.ads.VersionInfo
. We recommend adapters return the new type since com.google.android.gms.ads.mediation.VersionInfo
is deprecated.AppOpenAd.load()
methods that accept an orientation input parameter and added new methods that don't take an orientation input. The new methods determine the orientation at request time, matching the behavior of other full-screen formats.RECEIVE_BOOT_COMPLETED
permission from the androidx.work:work-runtime
dependency. If you're using Gradle versions earlier than 7.2.0 and require permission for your app, you may need to declare permission explicitly in your Android manifest.ca-app-pub-################~##########
format. See Configure your app for more details.QueryInfo
generation.getMediaContent()
to MediaView
.getMediaContent()
to NativeCustomFormatAd
.getVideoMediaView()
. Create your own MediaView
and use NativeCustomFormatAd.getMediaContent()
instead.getVideoController()
. Use NativeCustomFormatAd.getMediaContent().getVideoController()
instead.WebView
. See Integrate the WebView API for ads for more details.getResponseExtras()
to ResponseInfo
which may return extra information about the ad response. Beta: The getResponseExtras()
API is in beta. The return value might change without an SDK release.@NonNull
annotations in every method that previously did not explicitly define nullability.AdRequest.Builder.addNetworkExtras()
method. Use AdRequest.Builder.addNetworkExtrasBundle()
instead.setLocation()
on AdRequest.Builder
getLocation()
on AdRequest
getLocation()
on MediationAdConfiguration
MobileAds.getVersionString()
. Use MobileAds.getVersion()
instead.getLoadedAdapterResponseInfo()
method in ResponseInfo
.AdapterResponseInfo
:
getAdSourceName()
getAdSourceId()
getAdSourceInstanceName()
getAdSourceInstanceId()
Adapter
class and MediationAdLoadCallback
interface instead.gad_has_consent_for_cookies
. The Google Mobile Ads SDK will enable limited ads (LTD) when the gad_has_consent_for_cookies
preference is set to 0. See setting consent for cookies for more details.RequestConfiguration.Builder.setTagForChildDirectedTreatment()
is called with TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE
(see child-directed setting), or RequestConfiguration.Builder.setTagForUnderAgeOfConsent()
is called with TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE
(see users under the age of consent setting).androidx.work:work-runtime:2.7.0
to fix a bug causing app crashes on Android S with the following stack trace:
Fatal Exception: java.lang.IllegalArgumentException: com.mycompany.myapp: Targeting S+ (version 10000 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:386) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:657) at android.app.PendingIntent.getBroadcast(PendingIntent.java:644) at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174) at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108) at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86) at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:920)
To fix this bug, add the following dependencies for the Google Mobile Ads SDK to your module's app-level Gradle file:
dependencies { implementation 'com.google.android.gms:play-services-ads:20.4.0' // For apps targeting Android 12, add WorkManager dependency. constraints { implementation('androidx.work:work-runtime:2.7.0') { because '''androidx.work:work-runtime:2.1.0 pulled from play-services-ads has a bug using PendingIntent without FLAG_IMMUTABLE or FLAG_MUTABLE and will fail in Apps targeting S+.''' } } }
com.google.android.gms.permission.AD_ID
permission in the SDK's manifest that is automatically merged into the app manifest by Android build tools. To learn more about the AD_ID
permission declaration, including how to disable it, refer to this Play Console Help article.onAdClicked()
callback to FullScreenContentCallback
.onAdClicked()
callback in the AdListener
class for native ad format.AdRequest.Builder.addNetworkExtras()
method. Use AdRequest.Builder.addNetworkExtrasBundle()
instead.AdLoader.Builder.forCustomFormatAd()
now accepts a nullable OnCustomClickListener
.mediationExtras
parameter in all mediation adapter load calls.AdSize.getInlineAdaptiveBannerAdSize()
to request inline adaptive banner ads with a maximum height.AdError.toString()
for easier logging.Interstitial
API.RewardedVideoAd
API.Publisher
(e.g.: PublisherAdView
).CustomRenderedAd
.InstreamAd
.SearchAdRequest
.AdListener.onAdLeftApplication()
.NativeAppInstallAd
, NativeContentAd
, and UnifiedNativeAd
. There is now one native ad format named NativeAd
.RewardedAd
is now an abstract class. Use the RewardedAd.load()
static method to load a rewarded ad.AdSize.SMART_BANNER
in favor of adaptive banner ads.onAdImpression()
callback to FullScreenContentCallback
.InstreamAd
format.MediationBannerAdapter
, MediationInterstitialAdapter
, and MediationNativeAdapter
. New adapters should implement the Adapter
class to load these formats. Note: These deprecated mediation adapter classes won't be removed in version 20.0.0 in order to give mediation adapters time to transition to the new API.Adapter
class for RTB-specific formats.InterstitialAd
RewardedAd
NativeAd
AppOpenAd
CustomRenderedAd
.Publisher
have been deprecated and replaced with the prefix AdManager
.onAdLeftApplication() AdListener
method.onAdImpression() AdListener
method is now called for banner ads.setHttpTimeoutMillis()
method to customize the timeout for HTTPS calls made by the Google Mobile Ads SDK.AppOpenAd
format to operate more like a full screen format than a banner view. Added getResponseInfo()
and show()
methods to AppOpenAd
. Deprecated AppOpenAdView
and AppOpenAdPresentationCallback
classes.ResponseInfo.getAdapterResponses()
to get response information for each ad network that participated in an ad request.RewardedVideoAd
.MobileAds.initialize()
only calls back completion handler once. Every call to MobileAds.initialize()
now invokes the completion callback.targetSdkVersion
to API 30.
getDomain()
and getCause()
methods to AdError
.LoadAdError
. E.g., onAdFailedToLoad(LoadAdError)
.onAdFailedToLoad(int)
.onRewardedAdFailedToShow(AdError)
and deprecated onRewardedAdFailedToShow(int)
.MEDIATION_SHOW_ERROR
presentation error code. All presentation errors related to mediated ads now return MEDIATION_SHOW_ERROR
for AdError.getCode()
and a NonNull AdError.getCause()
representing the underlying mediation error.RewardedInterstitialAd
format. This feature is currently in private beta. Reach out to your account manager to request access.MobileAds.disableMediationAdapterInitialization()
method. Call this method prior to initializing the Google Mobile Ads SDK to disable mediation adapter initialization. Warning: Calling this method may negatively impact your Google mediation performance. This method should only be called if you include Google mediation adapters in your app but aren't mediating through Google during a particular app session (for example, you're running an A/B mediation test).MobileAds.initialize(Context, String)
in favor of MobileAds.initialize(Context, OnInitializationCompleteListener)
.AdRequest.isTestDevice()
now returns true
for test devices set through MobileAds.setRequestConfiguration()
.MobileAds.initialize()
that occurred on some devices on apps using the Lite SDK.NativeCustomTemplateAd
.MediaContent
to the com.google.android.gms.ads
package.us_privacy
string.setNeighboringContentUrls()
and getNeighboringContentUrls()
to AdRequest
.ResponseInfo
class which provides information about a loaded ad.getMediationAdapterClassName()
in favor of getResponseInfo()
.getDuration()
and getCurrentTime()
methods to MediaContent
.getDuration()
and getCurrentTime()
methods to UnifiedNativeAdMapper
for adapters to implement.AdRequest.Builder.addTestDevice()
. Use RequestConfiguration.Builder.setTestDeviceIds()
instead.InstreamAd
ad format. This feature is currently in private beta. Reach out to your account manager to request access.AdSize
class. For example, renamed AdSize.getCurrentOrientationBannerAdSizeWithWidth()
to AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize()
.setTestDeviceIds()
method to enable setting test devices once for all ad requests.AppOpenAd
format. This feature is currently in private beta. Reach out to your account manager to request access.MobileAds.initialize(Context, OnInitializationCompleteListener)
.MobileAds.initialize(Context, OnInitializationCompleteListener)
, that notifies you when the Google Mobile Ads SDK and all configured mediation adapters have completed initialization.MobileAds.getInitializationStatus()
to provide initialization status of all ad networks configured for your app.MobileAds.getRequestConfiguration()
. Targeting parameters set on this configuration object are used for all ad requests.NativeAdOptions.Builder.setMediaAspectRatio()
method to request a specific aspect ratio for a native ad's media asset. This option takes precedence over the now deprecated setImageOrientation()
method.MediaView.setImageScaleType()
.UnifiedNativeAd.getMediaContent()
. Publishers who only load images via URLs can now get the ad's media content, supply an image to it, and call MediaView.setMediaContent()
to populate image data through MediaView
for non-video ads.UnifiedNativeAdMapper.setMediaContentAspectRatio()
.play-services-measurement
and play-services-measurement-sdk
. Apps no longer need to add these dependencies explicitly.com.google.android.gms:play-services-measurement:17.0.0 com.google.android.gms:play-services-measurement-sdk:17.0.0
android.media.AudioManager.getStreamVolume
.Adapter
class.firebase-analytics
along with version 17.2.0
of any of the ads library (e.g., com.google.android.gms:play-services-ads:17.2.0
) must use com.google.firebase:firebase-analytics:16.3.0
.firebase-analytics
along with version 17.1.3
of any of the ads library (e.g., com.google.android.gms:play-services-ads:17.1.3
) must use com.google.firebase:firebase-analytics:16.3.0
.firebase-analytics
along with version 17.1.2
of any of the ads library (e.g., com.google.android.gms:play-services-ads:17.1.2
) must use com.google.firebase:firebase-analytics:16.0.6
.play-services-ads
& firebase-analytics
(e.g., ads:17.1.0
& analytics:16.0.5
) resulted in a duplicate entry
compiler error. Publishers using firebase-analytics
along with version 17.1.1
of any of the ads library (e.g., com.google.android.gms:play-services-ads:17.1.1
) must use com.google.firebase:firebase-analytics:16.0.5
.setMaxAdContentRating()
and setTagForUnderAgeOfConsent()
methods to AdRequest.Builder
.AdRequest.Builder.setMaxAdContentRating()
and AdRequest.Builder.setTagForUnderAgeOfConsent()
:
MAX_AD_CONTENT_RATING_G
MAX_AD_CONTENT_RATING_PG
MAX_AD_CONTENT_RATING_T
MAX_AD_CONTENT_RATING_MA
TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE
TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE
TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED
<meta-data>
tag with key com.google.android.gms.ads.APPLICATION_ID
in their AndroidManifest.xml. Refer to the Get Started guide for more details.NativeAppInstallAd
, NativeContentAd
, and associated APIs are deprecated in favor of UnifiedNativeAd
. Refer to Native Ads Advanced Unified for further instructions on using the new APIs.setAdMetadataListener
method on RewardedVideoAd
to listen for ad metadata changes.destroy()
will null out the listener.AdRequest.Builder
.
onRewardedVideoCompleted()
wasn't firing on emulators.NativeAppInstallAds
and NativeContentAds
into one new type: UnifiedNativeAd
.onRewardedVideoCompleted()
callback method to RewardedVideoAdListener
. To avoid a compilation error when updating to version 12.0.0, apps need to override this callback in their RewardedVideoAdListener
implementation.trackViews()
method to NativeAdMapper
, giving adapters access to View
objects corresponding to individual native ad assets. Deprecated trackView()
in favor of trackViews()
.NativeAdViewHolder
class and related methods in NativeAppInstallAd
and NativeContentAd
.AdLoader.getMediationAdapterClassName
(publishers should instead use the methods of the same name in NativeAppInstallAd
and NativeContentAd
).getMediationAdapterClassName()
methods to the NativeAppInstallAd
and NativeContentAd
classes. The method of the same name in AdLoader
will be deprecated.onVideoEnd()
method to the MediationNativeListener
class, hasVideoContent()
, setHasVideoContent()
, and setMediaView()
methods to the NativeAdMapper
class, and getAdVolume()
and isAdMuted()
methods to the NativeMediationAdRequest
class to support native video mediation.SearchAdRequest
class.loadAd()
method that takes in a PublisherAdRequest
object to the RewardedVideoAd
class.loadAds()
method to the AdLoader
class, which allows apps to load multiple unique ads in a single request.build.gradle
must also be updated to specify a compileSdkVersion
of at least 26
(Android O). This does not change the way your app runs. You will not be required to update targetSdkVersion
.onAdClicked()
and onAdImpression()
methods to the AdListener
class. These methods are only invoked for native app install and native content ads.getInAppPurchaseListener()
and setInAppPurchaseListener()
methods from the AdView
, InterstitialAd
, and NativeExpressAdView
classes. Also removed related in-app purchase classes.OnVideoMute()
, OnVideoPause()
, OnVideoPlay()
and OnVideoStart()
methods to the VideoController.VideoLifecycleCallbacks
class.setImmersiveMode()
method to the PublisherInterstitialAd
and RewardedVideoAd
classes.OnPublisherAdViewLoadedListener
interface, PublisherAdViewOptions
class, and PublisherAdViewOptions.Builder
class for use with AdLoader
for native-plus-banner requests.OnImmersiveModeUpdatedListener
interface that mediation adapters can implement to be informed of immersive mode updates.getMediationAdapterClassName()
method to the RewardedVideoAd
class.keep
rules to automatically preserve mediation adapter class names when using ProGuard.getVideoController()
, setVideoOptions()
, and getVideoOptions()
methods to the PublisherAdView
class.AdChoicesView
class.getAdChoicesContent()
and setAdChoicesContent()
methods to the NativeAdMapper
class.InitializableMediationRewardedVideoAdAdapter
interface for rewarded video mediation adapters that want to opt in to early initialization before an ad request is made.MobileAds.Initialize(Context)
has been un-deprecated. Google Ad Manager publishers should call this method when initializing their apps. AdMob publishers should still use MobileAds.Initialize(Context, String)
and pass their application code.MediaView
class for Native Ads Advanced video ads.openDebugMenu()
method to the MobileAds
class for creative preview and troubleshooting of Ad Manager ad units.setAdChoicesPlacement()
method to the NativeAdOptions.Builder
class, which app publishers can now use to specify the location of their AdChoices
in native ads.keep
option for com.google.android.gms.common.util.DynamiteApi
.setAppMuted()
method.MobileAds.initialize(android.content.Context, java.lang.String)
method is no longer deprecated.MobileAds.initialize(android.content.Context)
method is now deprecated.MediationNativeListener.onAdImpression()
method for reporting impressions in mediation adapters.keep
option to their ProGuard configuration file: -keep public @com.google.android.gms.common.util.DynamiteApi class * { *; }
MobileAds.setAppVolume()
, to inform the Mobile Ads SDK of an app's current volume level.isLoading()
method to PublisherAdView
and PublisherInterstitialAd
to check if an ad request is in progress.setIsDesignedForFamilies()
method to AdRequest.Builder
and PublisherAdRequest.Builder
.destroy()
method to NativeAdView
.isLoading()
method to AdLoader
, AdView
, and InterstitialAd
to check if an ad request is in progress.PublisherAdRequest.Builder#setManualImpressionsEnabled()
. Use PublisherAdView#setManualImpressionsEnabled()
instead.addCustomTargeting()
and addCategoryExclusion()
methods to PublisherAdRequest.Builder
.PublisherAdView.recordManualImpression()
to record multiple impressions in Ad Manager when using manual impression counting.android:largestWidthLimitDp
attribute on the <supports-screens>
tag.setRequestAgent()
method to AdRequest.Builder
and PublisherAdRequest.Builder
. This method should be used to denote ad request origins by third parties that mediate to the Mobile Ads SDK.com.google.android.gms:play‑services‑ads:6.+
. com.google.android.gms:play‑services:6.+
.getLocation()
method to com.google.android.gms.ads.MediationAdRequest
.getMediationAdapterClassName()
to AdView
to get the class name of the ad network mediation adapter currently showing an ad.LARGE_BANNER
ad format for both phones and tablets.InAppPurchaseListener
on InterstitialAd
to listen for in-app purchase events.SecurityException
crash due to reading gservices without permission.InterstitialAd
now functions if passed an application context.setContentUrl()
method to PublisherAdRequest.Builder
.AdRequest.Builder
now has a setLocation()
method.AdActivity
wasn't specified in the manifest.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3