PrivacySandboxCallback


@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS])
public annotation PrivacySandboxCallback


Annotated callbacks that can be passed to an SDK running in the Privacy Sandbox.

These can be used to provide the SDK with a channel to invoke app code, e.g. listeners. They should be public interfaces that only declare functions without implementation, and they may not extend any other interface. Callbacks run in the main thread by default.

The allowed types and return types are the same as for PrivacySandboxInterface.

Usage example:

@PrivacySandboxCallback
interface MyCallback {
fun onComplete(response: Response)
fun onClick(x: Int, y: Int)
fun onCompleteInterface(myInterface: MyInterface)
suspend fun getCallbackId(): String
}

Summary

Public constructors

Public constructors

PrivacySandboxCallback

public PrivacySandboxCallback()