CPChatDelegate

@objc
public protocol CPChatDelegate

An application should implement a class using this protocol and assign an instance of the class as the chatService object’s delegate in order to receive notification related to chat messaging.

  • This delegate method is called when an inbound chat message has been received by the backend. The application may choose to take some action upon receiving a message.

    Declaration

    Swift

    @objc
    func inboundMessageReceived(message: CPInboundMessage)

    Parameters

    message

    The received inbound message.

  • This delegate method is called when the delivery status of an chat message sent by this client changes. The application may choose to take some action upon receiving this status.

    Declaration

    Swift

    @objc
    func deliveryStatusChanged(status: CPMessageStatus)

    Parameters

    status

    Message status object describing the conversation and message that have changed.

  • This delegate method is called when any client using the API successfully sends an outbound chat message. This can be used to synchronize the local client with any other activity by another client. The application may choose to take some action upon receiving a message.

    Declaration

    Swift

    @objc
    func outboundMessageSent(message: CPOutboundMessage)

    Parameters

    message

    The outbound message that was sent from some client, not necessarily this application.

  • This delegate method is called when a chat message has been started. The remote party must indicate to the server that composition has begun. The message object received will be lacking content since it is not yet composed. The the application may choose to take some action upon receiving a message.

    Declaration

    Swift

    @objc
    func isComposing(message: CPIsComposingMessage)

    Parameters

    message

    An indication that the remote party is composing a message.

  • This delegate method is called when an invitation to join a chat group has been received.

    Declaration

    Swift

    @objc
    func groupInvitationReceived(invitation: CPChatGroupInvitation)

    Parameters

    invitation

    An invitation object that contains a copy of the group to be joined. The invitation object has methods for accept and decline.

  • This delegate method is called when the status of chat group members has been updated.

    Declaration

    Swift

    @objc
    func groupParticipantStatus(participants: [CPChatGroupParticipant])

    Parameters

    participants

    An array of chat group members that have updated status.

  • This delegate method is called when a group chat has ended.

    Declaration

    Swift

    @objc
    func groupChatEnded(groupID: String)

    Parameters

    groupID

    The groupID of the group chat that ended