CHLocale

An enum that represents set of supported locale

public enum CHLocale {
  KOREAN,
  JAPANESE,
  ENGLISH;
}

User

A object represents a guest

public class User {
  @NonNull
  private String id;

  @Nullable
  private String name;

  @Nullable
  private String avatarUrl;

  private int alert;

  @Nullable
  private Map<String, Object> profile;

  private boolean unsubscribed;

  @Nullable
  private List<String> tags;
}
parametertypedescription
idStringguest id
nameStringguest name
avatarUrlStringguest's avatar url if exist
alertintguest alert count
profileMap<String, Object>a dictionary contains guest's profile information
unsubscribedbooleana flag that user do not receive marketing messages
tagsListuser tags

LauncherConfig

An object represents a configuration for default launcher

public class LauncherConfig {
  Position position;
  float xMargin; // dp
  float yMargin; // dp
}

public enum Position {
  LEFT, RIGHT
}

Profile

Profile is an object containing user information that is used when boot

public class Profile {
  String name;
  String email;
  String avatarUrl;
  String mobileNumber;
  Map<String, Object> property;
}

setName

Returns Profile object with setting user name

public Profile setName(String name)
parametertypedescription
nameStringuser name

setEmail

Returns Profile object with setting email

public Profile setEmail(String email)
parametertypedescription
emailStringuser email

setAvatarUrl

Returns Profile object with setting avatar URL

public Profile setAvatarUrl(String avatarUrl)
parametertypedescription
avatarUrlStringurl of user image

setMobileNumber

Returns Profile object with setting mobile number

public Profile setMobileNumber(String mobileNumber)
parametertypedescription
mobileNumberStringuser's mobile number

setProperty

Returns Profile object with setting meta data

public Profile setProperty(String key, Object value)
parametertypedescription
keyStringproperty key
valueObject (except Boolean type)property value

Usage

Profile profile = Profile.create()
    .setName("Zoyi Guest")
    .setEmail("[email protected]")
    .setMobileNumber("+821012345678")
    .setAvatarUrl("http://channel.io")
    .setProperty("HomePage", "www.zoyi.co");

PushEvent

PushEvent is a object to represent in-app push information.

public class PushEvent {
  String chatId;
  
  @Nullable
  String senderAvatarUrl;
  
  @Nullable
  String senderName;
  
  @Nullable
  String message;
}
parametertypedescription
chatIdStringuser chat id
messageStringpush message from sender
senderNameStringsender's name
senderAvatarUrlStringsender's avatar url

UserData

UserData is a model with builder to update user information.

UserData userData = new UserData.Builder()
  .setLocale(locale)
  .setProfileMap(profileMap)
  .setProfileOnceMap(null)
  .setTags(tags)
  .build()
  
ChannelIO.updateUser(userData, null);
functionsetter typedescription
setLocale()CHLocalea locale to set user's language
setProfileMap()Map<String, Object>a map to set profile. if set to null, all profile data is gone, else, overwrite key by key.
setProfileOncceMap()Map<String, Object>a map to set profile. If set to null, nothing happened. else, only the key that was not present is applied.
setTags()ListIf set to null, all tags are gone. this list is overwritten