Change log and release notes for the Meta Audience Network SDK for Android.
Action needed: Update your Android apps to SDK 6.5 to continue monetizing them on Audience Network
You'll need to update your Android apps to Audience SDK 6.5 or later to continue operating and monetizing on Audience Network. Older Audience Network SDKs are not compatible with apps that target Android 12+ (API level 31+) and won't work correctly for apps on these devices.
IllegalStateException
in Android MediaPlayer/apex/com.android.art/lib64/libart.so (art::OatHeader::IsDebuggable() const+124)
on Android 11.java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
.pc 00000000000830f0 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160)
crash.ClassNotFoundException when unmarshalling
crash.Launched a new flexible API for all ad formats. This allows all custom parameters for loading and showing ads to be specified using a builder object, which can be obtained through Ad.buildLoadConfig()
method call. The old API will still be supported in the near future, but will eventually be removed.
IntersitialAd ad = new InterstitialAd(Context, String); ad.loadAd(ad.buildLoadConfig() // LoadConfigBuilder .withBid(String) .withListener(AdListener) .withCacheFlags(CacheFlags) .build()); // builds LoadConfig
Changes to networking and caching logic to improve their performance.
We have changed the flag for the label for Mixed Audiences, from isChildDirected
to MixedAudience
. More information on Mixed Audiences and COPPA can be found here:
withPreloadedIconView
, allowing optional pre-caching of icon assets for native ads. A width and height must be specified.NativeAdBase .buildLoadAdConfig() // NativeAdBase.LoadAdConfigBuilder .withBidPayload(String) .withCacheFlags(MediaCacheFlags) .withPreloadedIconView(int w, int h) .loadAd();
loadAd()
request to an ad object if there is another request already loading or make a secondary showAd()
request to an ad object if there is already an ad on screen.ImageView
now interchangeable with MediaView
for NativeBannerAd
ImageView
with NativeBannerAd
Native Banner Ads can now be created with ImageView
. New methods (see below) have been added to allow this. Note that using MediaView
is still supported.
class NativeBannerAd { /** * Registers the given view as the container and the required ImageView as the Icon display * for this NativeBannerAd to handle impressions and clicks. * ImageView must be within the view passed as the container for this NativeBannerAd. * Applies a click handler to the entire unit. * @param view the View containing this NativeBannerAd for display * @param iconView ImageView to display Icon for this NativeBannerAd * * @since 5.4 */ public void registerViewForInteraction(View view, ImageView iconView); /** * Registers the given view as the container and the required ImageView as the Icon display * for this NativeBannerAd to handle impressions and clicks. * ImageView must be within the view passed as the container for this NativeBannerAd. * Applies a click handler to the entire unit. * @param view the View containing this NativeBannerAd for display * @param iconView ImageView to display Icon for this NativeBannerAd * @param clickableViews a list of all view elements that should handle taps on this unit * * @since 5.4 */ public void registerViewForInteraction( View view, ImageView iconView, @Nullable final List<View> clickableViews); }
Our Android SDK now uses a new cache for storing downloaded ads. This new cache is more reliable and should reduce the number of caching errors.
We now provide an example application that uses Meta Audience Network SDK in Kotlin.
Exoplayer is no longer a dependency of the SDK.
RecyclerView
.NativeBannerAd
.BidderTokenProvider.getBidderToken()
can now be called often and the bidder token is precomputed at startup so, once the SDK initializes, obtaining the bidder token should be faster than in previous versions, avoiding latency issues.isInitialized
) in AudienceNetworkAds
that allows applications to test whether the SDK is initialized. This allows publishers to avoid double initialization.getAdsProcessName
) in AudienceNetworkAds
that allows applications to check whether the current process is an internal SDK process (same as isInAdsProcess
that was introduced in 5.1). For publishers who want more control over their apps' processes, this can be used to filter the process spawned by the ads SDK.NativeAdViewAttributes
constructor now requires a Context object.AdOptionsView
.MediaView
(Native Ads).Fatal Exception: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
Android bug.Error: java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread.
Exception.AdOptionsView
for native ads which provides greater flexibility.Error: java.lang.RuntimeException: Unable to pause activity {com.your.app/com.facebook.ads.AudienceNetworkActivity}: java.lang.NullPointerException
for Carousel Interstitials.java.lang.NoSuchMethodError: android.view.ViewTreeObserver.removeOnGlobalLayoutListener
Exception.java.lang.IllegalStateException: The specified child already has a parent
Exception.