TopicsManager
public
final
class
TopicsManager
extends Object
| java.lang.Object | |
| ↳ | android.adservices.topics.TopicsManager |
TopicsManager 提供適用於應用程式和廣告 SDK 的 API,可透過隱私權取得使用者的興趣主題 以便保存。
您可以使用 Context.getSystemService(Class) 和 TopicsManager 類別取得 TopicsManager 的例項。
摘要
公用方法 | |
|---|---|
static
TopicsManager
|
get(Context context)
建立 TopicsManager 執行個體的工廠方法。 |
void
|
getTopics(GetTopicsRequest getTopicsRequest, Executor executor, OutcomeReceiver<GetTopicsResponse, Exception> callback)
傳回主題。 |
繼承方法 | |
|---|---|
公用方法
get
public static TopicsManager get (Context context)
建立 TopicsManager 執行個體的工廠方法。
| 參數 | |
|---|---|
context |
Context:要使用的 Context
此值不能為 null。 |
| 傳回 | |
|---|---|
TopicsManager |
TopicsManager 執行個體
此值不能為 null。 |
getTopics
public void getTopics (GetTopicsRequest getTopicsRequest, Executor executor, OutcomeReceiver<GetTopicsResponse, Exception> callback)
傳回主題。
系統需求:AdServicesPermissions.ACCESS_ADSERVICES_TOPICS
| 參數 | |
|---|---|
getTopicsRequest |
GetTopicsRequest:取得 Topics 的要求。
此值不能為 null。 |
executor |
Executor:執行回呼的執行程式。
此值不能為 null。
回呼和事件監聽器事件會透過這個
Executor,可讓您輕鬆控制
如何透過應用程式的主執行緒分派事件
可以使用
Context.getMainExecutor()。
否則,請提供會調度至適當執行緒的 Executor。 |
callback |
OutcomeReceiver:在主題可用或發生錯誤後呼叫的回呼。
此值不能為 null。 |
| 傳回 | |
|---|---|
void |
此值不能為 null。 |
| 擲回 | |
|---|---|
IllegalStateException |
如果這個 API 無法使用 |