com.yandex.metrica.profile
Class UserProfile
java.lang.Object
com.yandex.metrica.profile.UserProfile
public class UserProfile
extends java.lang.Object
Класс для хранения профиля пользователя.
Профиль пользователя — это набор пользовательских атрибутов. Сведения о профиле пользователя отображаются в отчете о профилях пользователей AppMetrica.
Объект UserProfile должен быть передан на сервер AppMetrica с помощью метода YandexMetrica.reportUserProfile(UserProfile)
класса YandexMetrica
.
Используйте методы класса Attribute
Профили пользователей хранятся на серверах AppMetrica.
ПРИМЕР:
UserProfile userProfile = new UserProfile.Builder()
.apply(Attribute.customString("foo_attribute").withValue("baz_value"))
.apply(Attribute.name().withName("John"))
.apply(Attribute.gender().withValue(GenderAttribute.Gender.MALE))
.apply(Attribute.notificationEnabled().withValue(false))
.build();
YandexMetrica.reportUserProfile(userProfile);
YandexMetrica.setProfileId("id_1");
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
static class | UserProfile.Builder
Конструктор создает объект класса
UserProfile . |
Method Summary
Modifier and Type | Method and Description |
---|---|
java.util.List<UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>> | getUserProfileUpdates() |
static UserProfile.Builder | newBuilder()
Создает объект
UserProfile.Builder . |
Method Detail
getUserProfileUpdates
@NonNull public java.util.List<UserProfileUpdate<? extends com.yandex.metrica.impl.profile.UserProfileUpdatePatcher>> getUserProfileUpdates()
newBuilder
@NonNull public static UserProfile.Builder newBuilder()
Создает объект
UserProfile.Builder
.- Returns:
- Объект
UserProfile.Builder
.