MeasurementManagerFutures


public 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 methods

abstract @NonNull ListenableFuture<Unit>

Delete previous registrations.

static final MeasurementManagerFutures
from(@NonNull Context context)

Creates MeasurementManagerFutures.

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

Get Measurement API status.

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

Register attribution sources(click or view).

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

Register an attribution source (click or view).

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

Register a trigger (conversion).

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

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

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

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

Public methods

deleteRegistrationsAsync

Added in 1.0.0
public abstract @NonNull ListenableFuture<UnitdeleteRegistrationsAsync(@NonNull DeletionRequest deletionRequest)

Delete previous registrations.

Parameters
@NonNull DeletionRequest deletionRequest

The request for deleting data.

Returns
@NonNull ListenableFuture<Unit>

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

from

Added in 1.0.0
public static final MeasurementManagerFutures from(@NonNull Context context)

Creates MeasurementManagerFutures.

Returns
MeasurementManagerFutures

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

getMeasurementApiStatusAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
public abstract @NonNull ListenableFuture<@NonNull IntegergetMeasurementApiStatusAsync()

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")
public abstract @NonNull ListenableFuture<UnitregisterSourceAsync(@NonNull SourceRegistrationRequest request)

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

Parameters
@NonNull SourceRegistrationRequest request

source registration request

registerSourceAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
public abstract @NonNull ListenableFuture<UnitregisterSourceAsync(
    @NonNull Uri attributionSource,
    InputEvent inputEvent
)

Register an attribution source (click or view).

Parameters
@NonNull Uri attributionSource

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")
public abstract @NonNull ListenableFuture<UnitregisterTriggerAsync(@NonNull Uri trigger)

Register a trigger (conversion).

Parameters
@NonNull Uri trigger

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")
public abstract @NonNull ListenableFuture<UnitregisterWebSourceAsync(@NonNull WebSourceRegistrationRequest request)

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
@NonNull WebSourceRegistrationRequest request

source registration request

registerWebTriggerAsync

Added in 1.0.0
@RequiresPermission(value = "android.permission.ACCESS_ADSERVICES_ATTRIBUTION")
public abstract @NonNull ListenableFuture<UnitregisterWebTriggerAsync(@NonNull WebTriggerRegistrationRequest request)

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
@NonNull WebTriggerRegistrationRequest request

trigger registration request