abstract class TopicsManager


TopicsManager provides APIs for App and Ad-Sdks to get the user interest topics in a privacy preserving way.

Summary

Public companion functions

TopicsManager?
obtain(context: Context)

Creates TopicsManager.

Public functions

abstract suspend GetTopicsResponse
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_TOPICS")
getTopics(request: GetTopicsRequest)

Return the topics.

Public companion functions

obtain

Added in 1.0.0
fun obtain(context: Context): TopicsManager?

Creates TopicsManager.

Returns
TopicsManager?

TopicsManagerCompat object. If the device is running an incompatible build, the value returned is null.

Public functions

getTopics

@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_TOPICS")
abstract suspend fun getTopics(request: GetTopicsRequest): GetTopicsResponse

Return the topics.

Parameters
request: GetTopicsRequest

The GetTopicsRequest for obtaining Topics.

Returns
GetTopicsResponse

GetTopicsResponse

Throws
java.lang.SecurityException

if caller is not authorized to call this API.

kotlin.IllegalStateException

if this API is not available.

android.os.LimitExceededException

if rate limit was reached.