Channel Developers

The delegate allows the reception of event callbacks from the SDK. Ensure that the delegate object isn’t nil. Here's an example:

Swift
Objective-C

Invoked when the Messenger is displayed. Examples include:

  • calls showMessenger

  • calls openChat

  • When the user opens messenger through Channel button

Swift
Objective-C

Invoked when the messenger is hidden. Examples include:

  • A call to hideMessenger

  • A call to sleep

  • A call to shutdown

  • When the user explicitly closes the messenger, such as by clicking the X button.

Swift
Objective-C

Invoked when the SDK finishes creating a new chat. Examples are the following:

  • Explicitly creating a chat by the user, such as by clicking a new Chat button.

  • calls openChat with chatId = nil

Swift
Objective-C

You shoud use onBadgeChanged(unread: Int, alert: Int).

Invoked when the count of the user’s badge is changed. Examples include:

  • boot

  • When the user receives messages or marketing messages

Swift
Objective-C

Invoked when the number of notifications changes or at boot. The details of this method's parameters, unread, and alert are as follows:

  • unread : The number of all unread notifications the user has. It includes the number of alert. It is displayed as a red dot on the Channel button.

  • alert : The number of important notifications that the user has not read. It is displayed as a number on the Channel button.

Swift
Objective-C

This callback is invoked when the user changes Follow-up information. ChannelIO.updateUser does not trigger it. Values in dictionaries are nullable.

Swift
Objective-C

Invoked when the user clicks a link in the chat or clicks the link button. If this method returns true, URL redirection performed by the SDK will not work.

Swift
Objective-C

Invoked when receiving In-app message popup. Examples include:

  • Receiving a message from the manager

  • Receiving a marketing message

Refer to the CHTPopupData documentation for details on the events that are parameters of this function.

Swift
Objective-C