Models
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;
}
parameter | type | description |
---|---|---|
id | String | guest id |
name | String | guest name |
avatarUrl | String | guest's avatar url if exist |
alert | int | guest alert count |
profile | Map<String, Object> | a dictionary contains guest's profile information |
unsubscribed | boolean | a flag that user do not receive marketing messages |
tags | List | user 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)
parameter | type | description |
---|---|---|
name | String | user name |
setEmail
Returns Profile
object with setting email
public Profile setEmail(String email)
parameter | type | description |
---|---|---|
String | user email |
setAvatarUrl
Returns Profile
object with setting avatar URL
public Profile setAvatarUrl(String avatarUrl)
parameter | type | description |
---|---|---|
avatarUrl | String | url of user image |
setMobileNumber
Returns Profile
object with setting mobile number
public Profile setMobileNumber(String mobileNumber)
parameter | type | description |
---|---|---|
mobileNumber | String | user's mobile number |
setProperty
Returns Profile
object with setting meta data
public Profile setProperty(String key, Object value)
parameter | type | description |
---|---|---|
key | String | property key |
value | Object (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;
}
parameter | type | description |
---|---|---|
chatId | String | user chat id |
message | String | push message from sender |
senderName | String | sender's name |
senderAvatarUrl | String | sender'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);
function | setter type | description |
---|---|---|
setLocale() | CHLocale | a 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() | List | If set to null, all tags are gone. this list is overwritten |
Updated almost 2 years ago