ApiRTC iOS SDK Documentation

Class Contact

open class Contact: Observable<ContactEvent>  

Designates another user which may or may not be currently connected

Contact Contact Descriptable Descriptable Contact->Descriptable Observable<ContactEvent> Observable<ContactEvent> Contact->Observable<ContactEvent>

Conforms To

Observable<ContactEvent>

Properties

id

open private(set) var id: String! 

call​State

open private(set) var callState: ContactCallState! 

user​Data

open private(set) var userData: [String: Any?]? 

Methods

in​Group(_:​)

open func inGroup(_ group: String) -> Bool  

Checks whether the contact is inside a given group

is​Online()

open func isOnline() -> Bool  

Checks whether the contact is online or not. Note: A contact will be shown online only if it is currently in a group subscribed by the user

call(stream:​options:​completion:​)

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

Invites the contact to a P2P call

on​Event(_:​_:​)

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

send​Message(message:​completion:​)

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

Send message to the contact