ApiRTC iOS SDK Documentation

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 Descriptable Descriptable Conversation->Descriptable 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

id

open private(set) var id: Int? 

public​Id

open private(set) var publicId: String? 

cloud​Public​Id

open private(set) var cloudPublicId: String? 

instance​Id

open private(set) var instanceId: String? 

access​Type

open private(set) var accessType: ConversationAccessType! 

status

open private(set) var status: ConversationStatus! 

group​Chat​Status

open private(set) var groupChatStatus: ConversationStatus! 

access

open private(set) var access: ConversationAccess? 

role

open private(set) var role: ConversationUserRole? 

friendly​Name

open private(set) var friendlyName: String? 

moderator​Id

open private(set) var moderatorId: String? 

owner​Id

open private(set) var ownerId: String? 

has​Password

open private(set) 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?, _ message: GroupChatMessage?) -> 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​New​Whiteboard​Session(completion:​)

open func startNewWhiteboardSession(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?]? = nil, completion: @escaping (_ error: Error?, _ media: MediaUploaded?) -> Void)  

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

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

get​Moderator()

open func getModerator() -> Contact?  

send​Raw​Data(data:​)

open func sendRawData(data: [String: Any])  

type​OfName(_:​)

open class func typeOfName(_ name: String) throws -> ConversationAccessType  

is​Name​Valid(_:​)

open class func isNameValid(_ name: String) -> Bool  

on​Event(_:​_:​)

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