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
Relationships
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!
groupChatStatus
var groupChatStatus: ConversationStatus!
access
var access: ConversationAccess?
role
var role: ConversationUserRole?
friendlyName
var friendlyName: String?
instanceId
var instanceId: String?
moderatorId
var moderatorId: String?
ownerId
var ownerId: String?
cloudId
var cloudId: String?
hasPassword
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
cancelJoin()
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
sendInvitation(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
isGroupChatJoined()
open func isGroupChatJoined() -> Bool
joinGroupChat(completion:)
open func joinGroupChat(completion: @escaping (_ error: Error?) -> Void)
leaveGroupChat(completion:)
open func leaveGroupChat(completion: @escaping (_ error: Error?) -> Void)
sendMessage(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
unpublishStreamWithId(_: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
subscribeToStream(streamId: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.
unsubscribeFromStreamWithId(_:)
open func unsubscribeFromStreamWithId(_ streamId: String)
Unsubscribes from a conversation's stream. The stream will be stopped on the user's side
getAvailableStreamList()
open func getAvailableStreamList() -> [StreamInfo]
Returns information for media streams available in the conversation
getSubscribedStreams()
open func getSubscribedStreams() -> [Stream]?
Returns subscribed streams list
getName()
open func getName() -> String
Returns this conversation's room name
getConversationCall(_:)
open func getConversationCall(_ streamId: String) -> ConversationCall?
Returns the conversation call for a stream with a given stream id
isJoined()
open func isJoined() -> Bool
Checks if the conversation is joined
startWhiteboardSession(completion:)
open func startWhiteboardSession(completion: @escaping (_ error: Error?, _ client: WhiteboardClient?) -> Void)
stopWhiteboardSession()
open func stopWhiteboardSession()
checkAccess(completion:)
open func checkAccess(completion: @escaping (_ error: Error?, _ access: ConversationAccess?) -> Void)
Returns the access status of the conversation
pushMedia(media:options:completion:)
open func pushMedia(media: Data, options: [String: Any?], completion: @escaping (_ error: Error?, _ media: MediaUploaded?) -> Void)
fetchMediaList(option:completion:)
open func fetchMediaList(option: [String: Any?]?, completion: ((_ error: Error?, _ medias: [Media]?) -> Void)? = nil)
onEvent(_:_:)
open override func onEvent(_ observer: AnyObject, _ callback: @escaping ((ConversationEvent) -> Void))