語言

AdSelectionManager.GetAdSelectionData 方法

定義

從裝置收集自訂受眾資料。

[Android.Runtime.Register("getAdSelectionData", "(Landroid/adservices/adselection/GetAdSelectionDataRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetGetAdSelectionData_Landroid_adservices_adselection_GetAdSelectionDataRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)]
public virtual void GetAdSelectionData(Android.AdServices.AdSelection.GetAdSelectionDataRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver receiver);
[<Android.Runtime.Register("getAdSelectionData", "(Landroid/adservices/adselection/GetAdSelectionDataRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetGetAdSelectionData_Landroid_adservices_adselection_GetAdSelectionDataRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)>]
abstract member GetAdSelectionData : Android.AdServices.AdSelection.GetAdSelectionDataRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.GetAdSelectionData : Android.AdServices.AdSelection.GetAdSelectionDataRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

參數

executor
IExecutor

這個值不可能為零值。 回調與監聽事件透過此執行器派遣,提供簡便控制使用執行緒的方式。 要透過應用程式的主執行緒派發事件,可以使用 Context.getMainExecutor()。 否則,提供一個執行者,將執行者派遣到適當的執行緒。

receiver
IOutcomeReceiver
屬性

備註

從裝置收集自訂受眾資料。 回傳一個壓縮且加密的 blob,送往拍賣伺服器進行廣告選擇。 欲了解更多詳情,請參閱競標與拍賣服務說明。

自訂受眾廣告必須具備 才能 ad_render_id 被收集的資格。

請參考 AdSelectionManager#persistAdSelectionResult 如何處理伺服器端用此 API 產生的 blob 執行廣告選取結果。

輸出由接收端傳遞,接收端會回傳 a GetAdSelectionDataOutcome 表示成功執行,或 Exception 包含拋出的異常類型及相應錯誤訊息。

如果拋出 , IllegalArgumentException 則是因為 API 收到的輸入參數無效,導致執行廣告選擇。

若 IllegalStateException 拋出錯誤訊息為「廣告選擇服務失敗」,則是廣告選擇服務內部故障所致。

若擲出, TimeoutException 則是在競標、計分或整體選拔過程中遇到超時時。

如果拋棄, LimitExceededException 通常是因為呼叫的套件超過允許的速率限制並被限速。

如果 SecurityException 被拋出,通常是因為呼叫者未被授權或未請求許可所致。

Java 文件 android.adservices.adselection.AdSelectionManager.getAdSelectionData(android.adservices.adselection.GetAdSelectionDataRequest, java.util.concurrent.Executor, android.os.OutcomeReceiver<android.adservices.adselection.GetAdSelectionDataOutcome, java.lang.Exception>)。

Android 參考資料。android.adservices.adselection.AdSelectionManager.getAdSelectionData

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於