WATRoom

public class WATRoom : NSObject

Class to be used to get room information and make actions inside this room.

  • Name of the room.

    Declaration

    Swift

    public var name: String
  • Room status : CLOSED or OPENED.

    Declaration

    Swift

    public var status: String
  • Last Update message in Room

    Declaration

    Swift

    public var lastUpdate: Double
  • Invites a registered user.

    Declaration

    Swift

    public func invite(user:WATUser,
                       role: WATInviteRole,
                       messsage: String,
                       completeCallback:@escaping(_ error: Error?, _ room: WATRoom, _ invite: WATInvite?) -> Void)

    Parameters

    user

    The WATUser instance to invite.

    role

    The role the guest will have : other choice than NONE (guest) isn’t taken into account yet.

    message

    The text that may be read as an invitation message.

    completeCallback

    Block called once the invitation has been registered. On failure, the first argument contains the details of the error while the others respectively represent the WATRoom instance where the communication should take place and the created WATInvite instance.

  • Joins the room this method is applied to. When fired, the participant status becomes CONNECTED and an automatic mecanism updates this status to WAS_CONNECTED in case of a disconnection.

    Declaration

    Swift

    public func join(completeCallback:@escaping(_ error: Error?) -> Void)

    Parameters

    completeCallback

    Block called once the action has been registered. On failure, the first argument contains the details of the error.

  • Leaves the room this method is applied to. When fired, it sets the connected status of the current participant to WAS_CONNECTED.

    Declaration

    Swift

    public func leave(completeCallback:@escaping(_ error: Error?) -> Void)

    Parameters

    completeCallback

    Block called once the action has been registered. On failure, the first argument contains the details of the error.

  • Gets all the messages of the room.

    Declaration

    Swift

    public func messages(completeCallback:@escaping(_ error: Error?, _ info: [WATMessage?]) -> Void)

    Parameters

    completeCallback

    Block called once the information is obtained. On failure, the first argument contains the details of the error while the second one reports the array containing the room messages.

  • Gets all the participants of the room.

    Declaration

    Swift

    public func participants(completeCallback:@escaping(_ error: Error?, _ info: [WATParticipant?]) -> Void)

    Parameters

    completeCallback

    Block called once the information is obtained. On failure, the first argument contains the details of the error while the second one reports the array containing the room participants.

  • Observes the last message text in the room.

    Declaration

    Swift

    public func onLastMsg(completeCallback:@escaping(_ error: Error?, _ info: String?) -> Void)

    Parameters

    completeCallback

    Block called once a new message arrives. On failure, the first argument contains the details of the error while the second one contains only the message text and not the message instance.

  • Observes new messages of the room.

    Declaration

    Swift

    public func onNewMessage(completeCallback:@escaping(_ error: Error?, _ info: WATMessage?) -> Void)

    Parameters

    completeCallback

    Block called once a new message arrives. On failure, the first argument contains the details of the error while the second one contains the WATMessage itself.

  • Observes the participant status modification in this room.

    Declaration

    Swift

    public func onParticipantStatusChanged(completeCallback:@escaping(_ error: Error?, _ info: WATParticipant?) -> Void)

    Parameters

    completeCallback

    Block called once the status of a participant has changed. On failure, the first argument contains the details of the error while the second one contains the concerned WATParticipant.

  • Removes observer for the last message text in the room.

    Declaration

    Swift

    public func offLastMsg()
  • Removes observer for new messages of the room.

    Declaration

    Swift

    public func offNewMessage()
  • Removes observer for the participant status modification in this room.

    Declaration

    Swift

    public func offParticipantStatusChanged()
  • Update attribute displaySince where user delete room

    Declaration

    Swift

    public  func updateDisplaySince ( roomId idroom : String  , userId  id  : String?,completeCallback:@escaping(_ error : Error?) -> Void)

    Parameters

    roomId

    uid of room

    userId

    uid of user

    completeCallback

    Block called once update effected. On failure contains the details of the error.