SippoChat

public class SippoChat: CustomStringConvertible

Represents a chat

  • Declaration

    Swift

    public var createdAt: Double
  • Declaration

    Swift

    public var chatID: String
  • Declaration

    Swift

    public var topic: String
  • Leave a chat room

    Declaration

    Swift

    public func leave()
  • Add participants to chat

    Declaration

    Swift

    public func add(participants: [String], task: @escaping (SippoTask<Void, SippoResourceError>) -> ())

    Parameters

    participants

    New participants

    task

    Async result

  • Remove participants from chat

    Declaration

    Swift

    public func remove(participants: [String])

    Parameters

    participants

    Participants to remove

  • Send a new message to Chat

    Declaration

    Swift

    public func send(message: String, task: @escaping (SippoTask<Void, SippoResourceError>) -> ())

    Parameters

    message

    The message to sent

    task

    Async result

  • Send a file to Chat

    Declaration

    Swift

    public func send(file: Data, named filename: String, task: @escaping (SippoTask<FileUpload, SippoResourceError>) -> ())

    Parameters

    file

    Data to send

    filename

    Name use to share it

    task

    Task is called several times in FileUpload updates, like progress or state changes

  • Send a file to Chat

    Declaration

    Swift

    public func cancel(fileUpload: FileUpload)

    Parameters

    file

    Data to send

    filename

    Name use to share it

  • All files that user had been shared

    Declaration

    Swift

    public func allSharedFiles(task: @escaping (SippoTask<[String], SippoResourceError>) -> ())

    Parameters

    task

    Async task with public urls

  • Stop sharing file

    Declaration

    Swift

    public func unshareFile(from url: String)

    Parameters

    url

    URL where the file is hosted

  • Get participants from chat

    Declaration

    Swift

    public func participants(completion: @escaping ([String]) -> ())

    Parameters

    completion

    Async result