This page describes Model of the ChannelIO React Native SDK (hereafter referred to as SDK).

BootConfig

Configures option for ChannelIO.boot. This model is used as a parameter for the boot method. For the example, See QuickStart.

fieldtypedescription
pluginKeystringPlugin Key of Channel.
memberId(optional) stringAn identifier to distinguish each member user.
memberHash(optional) stringA HMAC-SHA256 value of memberId. See enabling member hash.
profile(optional) ProfileA user’s Profile.
language(optional) LanguageA user’s language.
It is valid when creating a new user. The language of the user that already exists will not change.
unsubscribeEmail(optional) booleanSets whether to receive marketing messages via email.
unsubscribeTexting(optional) booleanSets whether to receive marketing messages via texting (SMS, LMS)
trackDefaultEvent(optional) booleanSets whether to track the default event such as PageView.
hidePopup(optional) booleanSets whether hide popups such as marketing popup and in-app notifications.
channelButtonOption(optional) ChannelButtonOptionAn option for Channel button.
You can set the position and margin of the Channel button. The unit of margin is pt (point).
bubbleOption(optional) BubbleOptionAn option for popups for bubble type of marketing messages, and in-app notifications. The unit of margin is pt (point.)
const config = {
  "pluginKey": YOUR_PLUGIN_KEY,
  "memberId": MEMBER_ID,
  "memberHash": MEMBER_HASH,
  "profile": {
    "name": NAME,
    "email": EMAIL,
    "mobileNumber": "+~~~",
    "avatarUrl": AVATAR_URL,
    OTHER_KEY: OTHER_VALUE,
  },
  "language": LANGUAGE, // "en", "ko", "jp"
  "unsubscribeEmail": BOOLEAN,
  "unsubscribeTexting": BOOLEAN,
  "trackDefaultEvent": BOOLEAN,
  "hidePopup": BOOLEAN,
  "channelButtonOption": {
    "xMargin": 16,
    "yMargin": 16,
    "position": POSITION,  // "left", "right"
  },
  "bubbleOption": {
    "yMargin": 30,
    "position" POSITION,   // "top", "bottom"
  }
}

ChannelIO.boot(config).then((result) => {
  // result.status
  // result.user
})

Language

Languages that the SDK supports.

// Set language to Korean
"language": "ko"

// Set language to Japanese
"language": "jp"

// Set language to English
"language": "en"

ChannelButtonOption

An option for modifying the position of Channel button.
You can set it left down or right down. The default value of position is right, the margin is 20 for each.

"channelButtonOption": {
  "xMargin": 16,
  "yMargin": 16,
  "position": POSITION,  // 'left', 'right'
}

BubbleOption

Sets the location and margin of the message and bubble-type marketing messages in the in-app.
Location defaults to top and margins default to 20 .

// Units of x and y are pt in iOS.
let bubbleOption = BubbleOption(
  position: .top, // .top or .bottom
  yMargin: 0
)

Profile

A user’s profile.

fieldtypedescription
name(optional) stringA name of a user.
email(optional) stringA email of a user.
mobileNumber(optional) stringA mobile number of a user
avatarUrl(optional) stringAn avatar URL of a user.
"profile": {
  "name": NAME,
  "email": EMAIL,
  "mobileNumber": "+~~~",
  "avatarUrl": AVATAR_URL,
  OTHER_KEY: OTHER_VALUE,
}

User

An user who has visited a website or app with Channel installed.

FieldTypeDescription
idstringAn identifier that Channel uses.
memberId(optional) stringAn identifier to distinguish member users. Anonymous user is null.
name(optional) stringA name of the user.
avatarUrl(optional) stringAn avatar URL of the user.
profile(optional) objectAn object that contains the user’s profile.
alertnumberAn unread message count of the user.
tags(optional) stringA tag list of the user.
languageLanguageA language of the user.
unsubscribeTexting(optional) booleanWhether to receive marketing messages via email.
unsubscribeEmail(optional) booleanWhether to receive marketing messages via texting (SMS, LMS)
const user = {
  "id": ID,
  "memberId": MEMBER_ID,
  "name": NAME,
  "avatarUrl": AVATAR_URL,
    "alert": ALERT_COUNT,
  "profile": {
    "name": PROFILE_NAME,
    "mobileNumber": "+~~~",
    "CUSTOM_VALUE_1": "VALUE_1",
    "CUSTOM_VALUE_2": "VALUE_2"
  }
  "unsubscribeEmail": BOOLEAN,}
  "unsubscribeTexting": BOOLEAN,
  "tags": ["1", "2", "3"],
  "language": LANGUAGE
}

PopupData

Data of the in-app popup.

FieldTypeDescription
chatIdstringA chat Id of the popup.
avatarURLstringA avatar URL of the popup.
namestringA name which displayed on the popup.
messagestringA message which displayed on the popup.
const popupData = {
  "chatId": CHAT_ID,
  "avatarUrl": AVATAR_URL,
  "name": NAME,
  "message": MESSAGE,
}

UserData

A model used for data configuration on updateUser .

fieldtypedescription
languageLanguageA user’s language.
tags(optional) stringA user’s tag list.
Overwrite with tag data you add.
The maximum number is ten and is not case-sensitive.
profile(optional) objectA user’s profile.
Overwrite with profile data you add. Initialize if you set the profile value to nil.
profileOnce(optional) objectA profile to add to the user.
Add a new profile value it it does not exist.
unsubscribeEmail(optional) booleanWhether to receive marketing messages via email.
unsubscribeTexting(optional) booleanWhether to receive marketing messages via email.
const user = {
  "language": LANGUAGE, // "ko", "jp", "en"
  "tags": ["1", "2", "3"],
  "profile": {
    "name": NAME,
    "email": EMAIL,
    "mobileNumber": '+~~~',
    "avatarUrl": AVATAR_URL,
    OTHER_KEY: OTHER_VALUE,
  },
  "profileOnce": {
  },
  "unsubscribeEmail": BOOLEAN,
  "unsubscribeTexting": BOOLEAN,
};

ChannelIO.updateUser(user).then((result) => {
  // result.error
  // result.user
});

BootStatus

An enum object for the boot result.

fielddescription
successThe boot was successful.
notInitializedChannelIO.initialize was not called.
networkTimeoutThe boot failed because of a network issue.
notAvailableVersionNot a supported SDK version.
serviceUnderConstructionChannel.io server is under construction.
requirePaymentThe channel is blocked or you need to check the subscription plan.
accessDeniedThe server responded with 4xx status code.
unknownAn unknown error.
"SUCCESS"
"NOT_INITIALIZED"
"NETWORK_TIMEOUT"
"NOT_AVAILABLE_VERSION"
"SERVICE_UNDER_CONSTRUCTION"
"REQUIRE_PAYMENT"
"ACCESS_DENIED"
"UNKNOWN_ERROR"