Channel Developers

parameter

type

required

description

application

UIApplication

O

An instance of the Application class.

Initialize the ChannelIO object. You need to invoke this method at least once before utilizing any of the other ChannelIO methods.

Swift
Objective-C

This is required when using SceneDelegate. It returns ChannelWindow with UIWindowScene. Declare a class variable for ChannelIO. In the example below, the variable is named channelWindow.

parameter

type

required

description

windowScene

UIWindow

O

An instance of the UIWindowScene class.

Swift
Objective-C

The delegation object for ChannelIO.

Swift
Objective-C

Load the information necessary to use the SDK. After successful Boot, you are ready to use the features of Channel Talk. For more details, refer to the Boot section.

parameter

type

required

description

config

CHTBootConfig

O

A configuration object forBoot.You can set thepluginKeyand customizeChannel buttonposition,among other options.

completion

((CHTBootStatus, CHTUser?) -> Void)?

X

A callback fromBootthat returns bootStatus and User.

Swift
Objective-C

Disables all features except for receiving system push notifications and using the Track. Real-time functionalities (such as chat, marketing pop-ups, etc.) cannot be used due to the disconnected socket communication with Channel Talk servers. For more detailed guidance, refer to About life cycle.

Swift
Objective-C

Disconnects the SDK from the channel. The use of all features of the SDK is suspended. For more detailed guidance, refer to About life cycle.

Swift
Objective-C

Displays the Channel button on the global screen.

Swift
Objective-C

Hides the Channel button on the global screen.

Swift
Objective-C

Displays the messenger.

Swift
Objective-C

Hides the messenger.

Swift
Objective-C

Opens User chat. If the chatId exists, open it; otherwise, start a new chat.

parameter

type

required

description

chatId

String?

X

This is the chat ID.If the chatId is invalid or nil,a new user chat is opened.

message

String?

X

This is the pre-filled message in the message input field when opening a new chat.It is valid when chatId is nil.

Swift
Objective-C

Deprecated. Use openWorkflow instead.

The support bot is no longer supported and was replaced by workflow. The behavior of openSupportBot is the same as that of openWorkflow. message parameter is ignored.

Opens User chat to run a specific Support bot.

parameter

type

required

description

supportBotId

String?

X

This is the support bot's ID.If supportBotId is invalid or nil,the chat room is closed.

message

String?

X

This message will be displayed in the input field after completing the support bot operation.

Swift
Objective-C

Opens a user chat and starts the specified workflow.

  • openWorkflow can only be executed when the workflow trigger is set to "When starting a chat via Channel Talk."

  • If a corresponded workflow with the provided workflowId is exists, it will be executed. if workflowId is invalid, an error page is displayed.

  • If you don't pass workflowId, no action is taken.

parameter

type

required

description

workflowId

String?

X

The ID of workflow to start with.An error page will be shown if such workflow does not exist.

Swift
Objective-C

Tracks the user's events. For more detailed instructions, refer to the event tracking documentation.

parameter

type

required

description

eventName

String

O

This is the name of the event to track,with a maximum length of 64 characters.

eventProperty

[String: Any]?

X

This is additional information about the event.

Swift
Objective-C

Sets the name of the screen along with user chat profile. If track is called before setPage, the event will not reflect the page information.

parameter

type

required

description

page

String?

X

This is the screen name when track is called. When calling .setPage(nil), the event's page is set to null.

profile

[String: Any]

X

The user chat profile value. - When nil is assigned to a specific field within the profile object, only the value of that field is cleared. - The user chat profile value is applied when a user chat is created.

Swift
Objective-C

Resets the name of the screen and user chat profile value set by setPage. The default page name is the name of the ViewController class that calls track.

Swift
Objective-C

Hides the Channel popup on the global screen.

Swift
Objective-C

Modifies user information.

parameter

type

required

description

userData

[String: Any?]

O

This is the user information to be updated.

completion

((Bool, CHTUser?) -> Void)?

X

This returns the result of user information modification.

Swift
Objective-C

Adds tags to the user.

parameter

type

required

description

tags

[String]

O

• The maximum number of tags that can be added is 10. • Tags are stored in lowercase. • Any tags that have already been added will be ignored. • nil, empty strings, or lists containing them are not allowed.

completion

((Error?, CHTUser?) -> Void)?

X

When adding tags, it returns a CHTUser object. If the addition fails, it returns an error.

Swift
Objective-C

Removes tags from the user, ignoring any tags that do not exist.

parameter

type

required

description

tags

[String]

O

These are the tags to be removed.Null,empty strings,or lists containing them are not allowed.

completion

((Error?, CHTUser?) -> Void)?

X

When removing tags,it returns aCHTUserobject.If the removal fails,it returns an error.

Swift
Objective-C

Informs ChannelTalk about updates to the device token.

parameter

type

required

description

deviceToken

Data

O

This is the device token required for receiving push notifications.

Swift
Objective-C

It checks if the push data should be processed by the SDK.

parameter

type

required

description

_

[AnyHashable: Any]

O

the userInfo object received through push notifications.

Swift
Objective-C

Notifies Channel Talk that the user has received a push notification.

Swift
Objective-C

Stores push information on the device.

Swift
Objective-C

Check for any saved push notifications from the Channel.

Swift
Objective-C

Opens a user chat using the stored push information on the device through storePushNotifcation .

Swift
Objective-C

Verify that the SDK is in a Boot state.

Swift
Objective-C

Sets the debug mode. If set to true, log messages will be displayed.

Swift
Objective-C

Configures the SDK's theme.

parameter

type

required

description

appearance

CHTAppearance

O

If specified as.lightor.dark,it locks the theme to the respective mode.If specified as.system,it follows the device's system theme.

Swift
Objective-C

Renamed to setAppearance.

Sets the appearance of the SDK.

parameter

type

required

description

appearance

CHTAppearance

O

If specified as.lightor.dark,it locks the theme to the respective mode.If specified as.system,it follows the device's system theme.

Swift
Objective-C