MeasurementManagerFutures


abstract class MeasurementManagerFutures


This provides APIs for App and Ad-Sdks to access Privacy Sandbox Measurement APIs in a privacy preserving way. This class can be used by Java clients.

Summary

Public companion functions

MeasurementManagerFutures?
from(context: Context)

Creates MeasurementManagerFutures.

Public functions

abstract ListenableFuture<Unit>

Delete previous registrations.

abstract ListenableFuture<Int>
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
getMeasurementApiStatusAsync()

Get Measurement API status.

abstract ListenableFuture<Unit>
@ExperimentalFeatures.RegisterSourceOptIn
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
registerSourceAsync(request: SourceRegistrationRequest)

Register attribution sources(click or view).

abstract ListenableFuture<Unit>
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
registerSourceAsync(attributionSource: Uri, inputEvent: InputEvent?)

Register an attribution source (click or view).

abstract ListenableFuture<Unit>
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
registerTriggerAsync(trigger: Uri)

Register a trigger (conversion).

abstract ListenableFuture<Unit>
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
registerWebSourceAsync(request: WebSourceRegistrationRequest)

Register an attribution source(click or view) from web context.

abstract ListenableFuture<Unit>
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
registerWebTriggerAsync(request: WebTriggerRegistrationRequest)

Register an attribution trigger(click or view) from web context.

Public companion functions

from

Added in 1.0.0
fun from(context: Context): MeasurementManagerFutures?

Creates MeasurementManagerFutures.

Returns
MeasurementManagerFutures?

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

Public functions

deleteRegistrationsAsync

Added in 1.0.0
abstract fun deleteRegistrationsAsync(deletionRequest: DeletionRequest): ListenableFuture<Unit>

Delete previous registrations.

Parameters
deletionRequest: DeletionRequest

The request for deleting data.

Returns
ListenableFuture<Unit>

ListenableFuture. If the deletion is successful, result is null.

getMeasurementApiStatusAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun getMeasurementApiStatusAsync(): ListenableFuture<Int>

Get Measurement API status.

The call returns an integer value (see MeasurementManager.MEASUREMENT_API_STATE_DISABLED and MeasurementManager.MEASUREMENT_API_STATE_ENABLED for possible values).

registerSourceAsync

Added in 1.1.0-beta11
@ExperimentalFeatures.RegisterSourceOptIn
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun registerSourceAsync(request: SourceRegistrationRequest): ListenableFuture<Unit>

Register attribution sources(click or view). This API will not process any redirects, all registration URLs should be supplied with the request.

Parameters
request: SourceRegistrationRequest

source registration request

registerSourceAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun registerSourceAsync(attributionSource: Uri, inputEvent: InputEvent?): ListenableFuture<Unit>

Register an attribution source (click or view).

Parameters
attributionSource: Uri

the platform issues a request to this URI in order to fetch metadata associated with the attribution source.

inputEvent: InputEvent?

either an InputEvent object (for a click event) or null (for a view event).

registerTriggerAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun registerTriggerAsync(trigger: Uri): ListenableFuture<Unit>

Register a trigger (conversion).

Parameters
trigger: Uri

the API issues a request to this URI to fetch metadata associated with the trigger.

registerWebSourceAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun registerWebSourceAsync(request: WebSourceRegistrationRequest): ListenableFuture<Unit>

Register an attribution source(click or view) from web context. This API will not process any redirects, all registration URLs should be supplied with the request. At least one of appDestination or webDestination parameters are required to be provided.

Parameters
request: WebSourceRegistrationRequest

source registration request

registerWebTriggerAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
abstract fun registerWebTriggerAsync(request: WebTriggerRegistrationRequest): ListenableFuture<Unit>

Register an attribution trigger(click or view) from web context. This API will not process any redirects, all registration URLs should be supplied with the request. OutcomeReceiver#onError}.

Parameters
request: WebTriggerRegistrationRequest

trigger registration request