TopicsManager
class TopicsManager
| kotlin.Any | |
| ↳ | android.adservices.topics.TopicsManager |
TopicsManager provides APIs for App and Ad-Sdks to get the user interest topics in a privacy preserving way.
The instance of the TopicsManager can be obtained using android.content.Context#getSystemService and TopicsManager class.
Summary
| Public methods | |
|---|---|
| static TopicsManager |
Factory method for creating an instance of TopicsManager. |
| Unit |
getTopics(getTopicsRequest: GetTopicsRequest, executor: Executor, callback: OutcomeReceiver<GetTopicsResponse!, Exception!>)Return the topics. |
Public methods
get
static fun get(context: Context): TopicsManager
Factory method for creating an instance of TopicsManager.
| Parameters | |
|---|---|
context |
Context: The Context to use This value cannot be null. |
| Return | |
|---|---|
TopicsManager |
A TopicsManager instance This value cannot be null. |
getTopics
fun getTopics(
getTopicsRequest: GetTopicsRequest,
executor: Executor,
callback: OutcomeReceiver<GetTopicsResponse!, Exception!>
): Unit
Return the topics.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_TOPICS
| Parameters | |
|---|---|
getTopicsRequest |
GetTopicsRequest: The request for obtaining Topics. This value cannot be null. |
executor |
Executor: The executor to run callback. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
OutcomeReceiver<GetTopicsResponse!, Exception!>: The callback that's called after topics are available or an error occurs. This value cannot be null. |
| Return | |
|---|---|
Unit |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if this API is not available. |