Language

CustomAudienceManager.JoinCustomAudience Method

Definition

Adds the user to the given CustomAudience.

[Android.Runtime.Register("joinCustomAudience", "(Landroid/adservices/customaudience/JoinCustomAudienceRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetJoinCustomAudience_Landroid_adservices_customaudience_JoinCustomAudienceRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=34)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_ADSERVICES_CUSTOM_AUDIENCE")]
public virtual void JoinCustomAudience(Android.AdServices.CustomAudiences.JoinCustomAudienceRequest joinCustomAudienceRequest, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver receiver);
[<Android.Runtime.Register("joinCustomAudience", "(Landroid/adservices/customaudience/JoinCustomAudienceRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetJoinCustomAudience_Landroid_adservices_customaudience_JoinCustomAudienceRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=34)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_ADSERVICES_CUSTOM_AUDIENCE")>]
abstract member JoinCustomAudience : Android.AdServices.CustomAudiences.JoinCustomAudienceRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.JoinCustomAudience : Android.AdServices.CustomAudiences.JoinCustomAudienceRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

joinCustomAudienceRequest
JoinCustomAudienceRequest

The non-null request containing the custom audience to register for the calling application.

executor
IExecutor

This value cannot be null. Service callbacks are dispatched through this executor. Some errors when accessing the service can be delivered directly to the receiver. To dispatch service callbacks through the main thread, use MainExecutor. Otherwise, provide an executor that dispatches to an appropriate thread.

receiver
IOutcomeReceiver

The non-null callback for the operation. In the Android 16 AOSP source, it can receive a result with no audience data or an exception. In the Android 17 AOSP source, both service callbacks report an exception.

Attributes

Remarks

Adds the user to the given CustomAudience.

An attempt to register the user for a custom audience with the same combination of ownerPackageName, buyer, and name will cause the existing custom audience's information to be overwritten, including the list of ads data.

Note that the ads list can be completely overwritten by the daily background fetch job.

This call fails with an SecurityException if

  1. the ownerPackageName is not calling app's package name and/or
  2. the buyer is not authorized to use the API.

This call fails with an IllegalArgumentException if

  1. the storage limit has been exceeded by the calling application and/or
  2. any URI parameters in the CustomAudience given are not authenticated with the CustomAudience buyer.

This call fails with LimitExceededException if the calling package exceeds the allowed rate limits and is throttled.

This call fails with an IllegalStateException if an internal service error is encountered.

Java documentation for android.adservices.customaudience.CustomAudienceManager.joinCustomAudience(android.adservices.customaudience.JoinCustomAudienceRequest, java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Object, java.lang.Exception>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to