ApiRTC iOS SDK Documentation Beta

Class Conversation

open class Conversation: Observable<ConversationEvent>

Users are able to interact with each other by entering a conversation in a N-N fashion. The client is able to listen to conversation events that will be fired once the conversation is joined

Conversation Conversation Observable<ConversationEvent> Observable<ConversationEvent> Conversation->Observable<ConversationEvent> Conference Conference Conference->Conversation

Subclasses

Conference

A conference is a type of Conversation that may require privilege to join Conference may only be created if your enterprise has the conference feature enabled on the Apizee platform

Conforms To

Observable<ConversationEvent>

Properties

status

var status: ConversationStatus!

group​Chat​Status

var groupChatStatus: ConversationStatus!

access

var access: ConversationAccess?

role

var role: ConversationUserRole?

friendly​Name

var friendlyName: String?

instance​Id

var instanceId: String?

moderator​Id

var moderatorId: String?

owner​Id

var ownerId: String?

cloud​Id

var cloudId: String?

has​Password

var hasPassword: Bool?

Methods

join(options:​completion:​)

open func join(options: JoinOptions? = nil, completion: @escaping (_ error: Error?, _ accessAllowed: Bool) -> Void)

Connects to a conversation if not already joined. Once in the conversation the user will be able to see other contacts inside it, send and receive messages, publish streams and subscribe to conversation's streams

cancel​Join()

open func cancelJoin()

leave(completion:​)

open func leave(completion: (() -> Void)? = nil)

Leaves conversation. The user will automatically stop publishing its streams to the conversation and stop subscribing to streams from the conversation. The user will no longer receive events from the conversation. The user will no longer see who's within the conversation

send​Invitation(contact:​completion:​)

open func sendInvitation(contact: Contact, completion: @escaping (_ error: Error?, _ invitation: SentInvitation?) -> Void)

Invites a contact to the conversation If returns nil, ConversationEvent.error(_:) should be dispatched

is​Group​Chat​Joined()

open func isGroupChatJoined() -> Bool

join​Group​Chat(completion:​)

open func joinGroupChat(completion: @escaping (_ error: Error?) -> Void)

leave​Group​Chat(completion:​)

open func leaveGroupChat(completion: @escaping (_ error: Error?) -> Void)

send​Message(message:​completion:​)

open func sendMessage(message: String, completion: @escaping (_ error: Error?) -> Void)

publish(stream:​options:​completion:​)

open func publish(stream: Stream, options: PublishOptions? = nil, completion: @escaping (_ error: Error?, _ stream: Stream?) -> Void)

Publish stream to conversation The stream will be able to be subscribed by other contacts within the conversation

unpublish​Stream​With​Id(_:​completion:​)

open func unpublishStreamWithId(_ streamId: String, completion: @escaping () -> Void)

Unpublishes currently published stream to conversation. If other users within the conversation subscribed to this stream, it will be stopped on their side

subscribe​ToStream(stream​Id:​options:​)

open func subscribeToStream(streamId: String, options: SubscribeOptions? = nil)

Subscribes to a stream. The subscription will automatically stop if the contact publishing the stream unpublishes it. The ConversationEvent.streamAdded(_:) event will be fired when the stream becomes available. The ConversationEvent.streamRemoved(_:) event will be fired when the stream is no longer available.

unsubscribe​From​Stream​With​Id(_:​)

open func unsubscribeFromStreamWithId(_ streamId: String)

Unsubscribes from a conversation's stream. The stream will be stopped on the user's side

get​Available​Stream​List()

open func getAvailableStreamList() -> [StreamInfo]

Returns information for media streams available in the conversation

get​Published​Streams()

open func getPublishedStreams() -> [Stream]?

Returns published streams list

get​Subscribed​Streams()

open func getSubscribedStreams() -> [Stream]?

Returns subscribed streams list

get​Contacts()

open func getContacts() -> [Contact]?

Returns contacts list within the conversation

get​Name()

open func getName() -> String

Returns this conversation's room name

get​Conversation​Call(_:​)

open func getConversationCall(_ streamId: String) -> ConversationCall?

Returns the conversation call for a stream with a given stream id

is​Joined()

open func isJoined() -> Bool

Checks if the conversation is joined

start​Whiteboard​Session(completion:​)

open func startWhiteboardSession(completion: @escaping (_ error: Error?, _ client: WhiteboardClient?) -> Void)

stop​Whiteboard​Session()

open func stopWhiteboardSession()

check​Access(completion:​)

open func checkAccess(completion: @escaping (_ error: Error?, _ access: ConversationAccess?) -> Void)

Returns the access status of the conversation

push​Media(media:​options:​completion:​)

open func pushMedia(media: Data, options: [String: Any?], completion: @escaping (_ error: Error?, _ media: MediaUploaded?) -> Void)

fetch​Media​List(option:​completion:​)

open func fetchMediaList(option: [String: Any?]?, completion: ((_ error: Error?, _ medias: [Media]?) -> Void)? = nil)

on​Event(_:​_:​)

open override func onEvent(_ observer: AnyObject, _ callback: @escaping ((ConversationEvent) -> Void))