Android 版 Meta Audience Network SDK 更新日志及发布说明。
需要采取行动:将您的 Android 应用更新至 SDK 6.5,以便继续使用 Audience Network 变现
您需要将自己的 Android 应用更新至 Audience SDK 6.5 或更高版本,以便继续使用 Audience Network 运行并实现变现。旧版的 Audience Network SDK 与针对 Android 12 及更高版本(API 级别为 31 以上)的应用不兼容,无法在这些设备的应用中正常运行。
IllegalStateException
问题/apex/com.android.art/lib64/libart.so (art::OatHeader::IsDebuggable() const+124)
问题。java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
问题。pc 00000000000830f0 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160)
崩溃的 Android OS 漏洞。ClassNotFoundException when unmarshalling
崩溃问题。已推出一种灵活的新 API,适用于所有广告格式。该 API 支持使用所有自定义参数来加载和显示要使用创建工具对象指定的广告。您可以通过调用 Ad.buildLoadConfig()
方法获得该对象。旧版 API 在不久的将来仍将受到支持,但最终将被移除。
IntersitialAd ad = new InterstitialAd(Context, String); ad.loadAd(ad.buildLoadConfig() // LoadConfigBuilder .withBid(String) .withListener(AdListener) .withCacheFlags(CacheFlags) .build()); // builds LoadConfig
更改网络和缓存逻辑,以改进其效果。
我们将与混合型受众的标签相对应的标记从 isChildDirected
更改为 MixedAudience
。如需详细了解混合型受众和 COPPA,请访问以下网址:
withPreloadedIconView
,支持预缓存原生广告的图标素材(可选)。必须指定宽度和高度。NativeAdBase .buildLoadAdConfig() // NativeAdBase.LoadAdConfigBuilder .withBidPayload(String) .withCacheFlags(MediaCacheFlags) .withPreloadedIconView(int w, int h) .loadAd();
loadAd()
请求;如果屏幕上已有一个广告,向相应广告对象发出第二个 showAd()
请求。NativeBannerAd
,ImageView
现在可与 MediaView
进行互换NativeBannerAd
替换了 ImageView
原生横幅广告现在可使用 ImageView
创建。添加了新方法(见下文)以实现此目的。请注意,当前仍支持使用 MediaView
。
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); }
我们的 Android SDK 现在采用全新缓存机制存储下载的广告。新缓存机制更可靠,将减少缓存出错的次数。
我们现在提供了一个示例应用程序,该应用程序会以 Kotlin 语言使用 Meta Audience Network SDK。
Exoplayer 将不再是该 SDK 的一个依赖项。
RecyclerView
全屏时,关闭图标大于预期。NativeBannerAd
的用户界面线程中将不再执行 I/O。BidderTokenProvider.getBidderToken()
,竞价方口令在启动时已经过预计算,因此,SDK 初始化之后,获得竞价方口令的速度应该比之前版本更快,从而避免出现延迟问题。AudienceNetworkAds
中的新方法 (isInitialized
),允许应用程序测试该 SDK 是否已初始化。发行商借此方法可以避免双重初始化。AudienceNetworkAds
中的新方法 (getAdsProcessName
) 支持应用程序检查当前流程是否属于内部 SDK 流程(与 5.1 中引入的 isInAdsProcess
相同)。对于那些想进一步控制应用过程的发行商来说,该方法可用来筛选由广告 SDK 产生的过程。NativeAdViewAttributes
构造函数现在要求使用 Context 对象。AdOptionsView
中广告举报图标的选项。MediaView
(原生广告)中的视频添加模糊背景。Fatal Exception: android.util.AndroidRuntimeException: android.content.pm.PackageManager$NameNotFoundException: com.google.android.webview
Android 漏洞。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.
异常问题。AdOptionsView
,可提供更大灵活性。Error: java.lang.RuntimeException: Unable to pause activity {com.your.app/com.facebook.ads.AudienceNetworkActivity}: java.lang.NullPointerException
问题。java.lang.NoSuchMethodError: android.view.ViewTreeObserver.removeOnGlobalLayoutListener
异常问题。java.lang.IllegalStateException: The specified child already has a parent
异常问题。