AppMetricaDeviceIDListener interface

com.yandex.metrica

public interface AppMetricaDeviceIDListener

The interface defines callback methods when requesting a unique AppMetrica ID.

To request a unique identifier, you should create an object that implements the AppMetricaDeviceIDListener interface and pass it to the YandexMetrica.requestAppMetricaDeviceID(AppMetricaDeviceIDListener listener) method.

Nested classes

Methods

voidonError(@NonNull AppMetricaDeviceIDListener.Reason reason)

This method is invoked when an error occurs while trying to obtain the unique identifier.

voidonLoaded(@Nullable String deviceID)

This method is invoked when obtaining the unique identifier.

Method descriptions

onError

void onError(@NonNull AppMetricaDeviceIDListener.Reason reason)

This method is invoked when an error occurs while trying to obtain the unique identifier.

Parameters:
reasonThe reason of the error from the AppMetricaDeviceIDListener.Reason enumeration.

onLoaded

void onLoaded(@Nullable String deviceID)

This method is invoked when obtaining the unique identifier.

Note. In the Logs API and Post API deviceID referred to as appmetrica_device_id.
Parameters:
deviceIDUnique AppMetrica ID.