Meta Audience Network Android 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,可讓您使用打造工具物件(可透過 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
,loadAd 不再於用戶介面執行緒中執行 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
例外狀況。