CHLocale

An enum that represents set of supported locale

@objc enum CHLocale: Int {
  case english
  case korean
  case japanese
  case device
}

User

A object represents a user

public class User: NSObject {
  public let id: String
  public let name: String
  public let avatarUrl: String?
  public let profile: [String : Any]?
  public let alert: Int
  public let tags: [String]?
  public let systemLanguage: String?
  public let language: String?
  public let unsubscribed: Bool
}
@interface Guest : NSObject
@property (nonatomic, readonly) NSString * _Nonnull id;
@property (nonatomic, readonly) NSString * _Nonnull name;
@property (nonatomic, readonly) NSString * avatarUrl;
@property (nonatomic, readonly) NSDictionary<NSString*, _Nonnull id> * profile;
@property (nonatomic, readonly) NSInteger alert;
@property (nonatomic, readonly, copy) NSArray<NSString *> * _Nullable tags;
@property (nonatomic, readonly, copy) NSString * _Nullable systemLanguage;
@property (nonatomic, readonly, copy) NSString * _Nullable language;
@property (nonatomic, readonly) BOOL unsubscribed;
@end
propertytypedescription
idStringuser id
nameStringuser name
avatarUrlStringuser's avatar url if exist
profile[String: Any]a dictionary contains user's profile information
alertIntuser alert count
tags[String]user's tags
systemLanguageStringui language
languageStringuser's language
unsubscribedBooluser's marketing accept value

LauncherConfig

An object represents a configuration for default launcher

class LauncherConfig: NSObject, NSCoding {
  var position: LauncherPosition = .right
  var xMargin: Float = 20
  var yMargin: Float = 20
}

enum LauncherPosition: Int {
  case right
  case left
}
@interface LauncherConfig : NSObject <NSCoding>
@property (nonatomic) enum LauncherPosition position;
@property (nonatomic) float xMargin;
@property (nonatomic) float yMargin;
- (nonnull instancetype)init;
@end
  
typedef SWIFT_ENUM(NSInteger, LauncherPosition) {
  LauncherPositionRight = 0,
  LauncherPositionLeft = 1,
};

UpdateUserParamBuilder(UpdateUserParamObjcBuilder)

An object that contains user's update information

with

Return 'UpdateUserParamBuilder' with user's profile

func with(profile: [String: Any?]?) -> UpdateUserParamBuilder
- (UpdateUserParamObjcBuilder * _Nonnull)withProfileKey:(NSString * _Nonnull)profileKey value:(id _Nullable)value;
- (UpdateUserParamObjcBuilder * _Nonnull)setProfileNil;

with

Return 'UpdateUserParamBuilder' with user's profileOnce

func with(profileOnce: [String: Any?]?) -> UpdateUserParamBuilder
- (UpdateUserParamObjcBuilder * _Nonnull)withProfileOnceKey:(NSString * _Nonnull)profileOnceKey value:(id _Nullable)value;
- (UpdateUserParamObjcBuilder * _Nonnull)setProfileOnceeNil;

with

Return 'UpdateUserParamBuilder' with user's tags

func with(tags: [String]?) -> UpdateUserParamBuilder
- (UpdateUserParamObjcBuilder * _Nonnull)withTags:(NSArray<NSString *> * _Nullable)tags;

with

Return 'UpdateUserParamBuilder' with user's language

func with(language: CHLocale) -> UpdateUserParamBuilder
- (UpdateUserParamObjcBuilder * _Nonnull)withLanguage:(enum CHLocale)language;

with

Return 'UpdateUserParamBuilder' with built params

func build() -> UpdateUserParam
- (NSDictionary<NSString *, id> * _Nonnull)build SWIFT_WARN_UNUSED_RESULT;

Profile

An object that contains user information

set

Returns Profile object with setting name

public func set(name: String) -> Profile
-(Profile * _Nonnull)setName:(NSString *)name
parametertypedescription
nameStringuser name

set

Returns Profile object with setting avatar url

public func set(avatarUrl: String) -> Profile
- (Profile * _Nonnull)setWithAvatarUrl:(NSString * _Nonnull)avatarUrl
parametertypedescription
avatarUrlStringa url of user avatar image

set

Returns Profile object with setting mobile number

public func set(mobileNumber: String) -> Profile
- (Profile * _Nonnull)setWithMobileNumber:(NSString * _Nonnull)mobileNumber
parametertypedescription
mobileNumberStringa mobile number

set

Returns Profile object with setting email

public func set(email: String) -> Profile
- (Profile * _Nonnull)setWithEmail:(NSString * _Nonnull)email;

set

Returns Profile object with setting property data

public func set(propertyKey: String, value:AnyObject?) -> Profile
- (Profile * _Nonnull)setWithPropertyKey:(NSString * _Nonnull)propertyKey value:(id)value
parametertypedescription
propertyKeyStringmeta key
valueAnyObjecta value

Since all of methods return object itself, you can chain methods in swift

let profile = Profile()
profile
  .set(name: "ZOYI")
  .set(avatarUrl: "http://channel.io")
  .set(mobileNumber: "+8201012345678")
  .set(propertyKey: "DNA", value: "Sexy" as AnyObject)
  .set(propertyKey: "Potential", value: 1000000 as AnyObject)
Guest *guest = [[Guest alloc] init];
[guest setWithName:@"ZOYI"];
[guest setWithId:@"123"];
[guest setWithAvatarUrl:@"http://channel.io"];
[guest setWithMobileNumber:@"+8201012345678"];
[guest setWithPropertyKey:@"DNA" value:@"Sexy"];
[guest setWithPropertyKey:@"Potential" value:@(100000)];

PushEvent

PushEvent is an object to represent push notification's information.

public class PushEvent: NSObject {
  let chatId: String
  let message: String
  let senderName: String
  let senderAvatarUrl: String
}
@interface PushEvent : NSObject
@property (nonatomic, readonly) NSString * _Nonnull chatId;
@property (nonatomic, readonly) NSString * _Nonnull message;
@property (nonatomic, readonly) NSString * _Nonnull senderName;
@property (nonatomic, readonly) NSString * _Nonnull senderAvatarUrl;
@end
propertytypedescription
chatIdStringuser chat id
messageStringpush message from sender
senderNameStringsender's name
senderAvatarUrlStringsender's avatar url