AdvertisingIdProviderManager

public class AdvertisingIdProviderManager


The AdvertisingIdProviderManager will be used by an Advertising ID Provider to register the provider implementation or retrieve all the Advertising ID Providers on the device. This package contains an implementation of the Advertising ID Provider Service that supports IAdvertisingIdService.aidl for communication with the developer library, allowing you to easily make your own Advertising ID Provider. Simply do the following:

  1. Implement the AdvertisingIdProvider interface in the provider library. Developer apps will be interacting with the provider through this programmatic interface.
  2. Register the implementation by calling registerProviderCallable within the provider’s onCreate callback.
  3. Register the Advertising Id settings UI with the intent filter "androidx.ads.identifier.provider.OPEN_SETTINGS".

Summary

Public methods

static @NonNull List<AdvertisingIdProviderInfo>

Retrieves a list of all the Advertising ID Providers' information on this device, including self and other providers which is based on the AndroidX Advertising ID Provider library.

static void

Registers the Callable to create an instance of AdvertisingIdProvider.

Public methods

getAdvertisingIdProviders

public static @NonNull List<AdvertisingIdProviderInfogetAdvertisingIdProviders(@NonNull Context context)

Retrieves a list of all the Advertising ID Providers' information on this device, including self and other providers which is based on the AndroidX Advertising ID Provider library.

This method helps one Advertising ID Provider find other providers. One usage of this is to link to other providers' settings activity from one provider's settings activity, so the user of the device can manager all the providers' settings together.

registerProviderCallable

public static void registerProviderCallable(
    @NonNull Callable<AdvertisingIdProvider> providerCallable
)

Registers the Callable to create an instance of AdvertisingIdProvider.

This is used to lazy load the AdvertisingIdProvider when the Service is started.

This Callable will be called within the library's built-in Advertising ID Service's onCreate method.

Provider could call this method to register the implementation in onCreate, which is before onCreate has been called.