Room

iOS Room APIs

Create a room

- (MXHTTPOperation*)createRoom:(NSString*)name
                    visibility:(MXRoomDirectoryVisibility)visibility
                     roomAlias:(NSString*)roomAlias
                         topic:(NSString*)topic
                       success:(void (^)(MXCreateRoomResponse *response))success
                       failure:(void (^)(NSError *error))failure NS_SWIFT_UNAVAILABLE("TEST");

Input Parameters:

NameTypeDescriptionRequired

name

NSString

the room name

false

visibility

NSString

the visibility of the room

false

roomAlias

NSString

the room alias on the node the room will be created

false

topic

NSString

the room topic

false

Output Parameters:

MXCreateRoomResponse

NameTypeDescriptionRequired

roomId

NSString

The allocated room id

true

Create a room with parameters

- (MXHTTPOperation*)createRoomWithParameters:(MXRoomCreationParameters*)parameters
                                     success:(void (^)(MXCreateRoomResponse *response))success
                                     failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters:

NameTypeDescriptionRequired

parameters

NSString

MXRoomCreationParameters

true

Output Parameters:

MXCreateRoomResponse

NameTypeDescriptionRequired

roomId

NSString

The allocated room id

true

Join a chat room

client?.joinRoom(room_id, completion: { response in })

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

Invite user to the room

client?.invite(user_id, toRoom: room_id) { response in }

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

user_id

string

user id

true

Leave the room

client?.leaveRoom(room_id, completion: { response in })

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

Remove a user from the room

client?.banUser(user_id, fromRoom: room_id, reason: reason, completion: { response in })

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

user_id

String

user id

true

reason

String

reason string

true

Modify room name

client?.setName(ofRoom: room_id, name: name, completion: { response in })

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

name

string

new room name

true

Get room name

client?.name(ofRoom: room_id, completion: { response in })

Parameters:

NameTypeDescriptionRequired

room_id

string

room id

true

Ban User from a room

- (MXHTTPOperation*)banUser:(NSString*)userId
                     inRoom:(NSString*)roomId
                     reason:(NSString*)reason
                    success:(void (^)(void))success
                    failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters

NameTypeDescriptionRequired

userId

NSString

user id

true

roomId

NSString

room id

true

reason

NSString

reason of banning the user

false

Output Parameters

NameTypeDescriptionRequired

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true

Unban user from a room

- (MXHTTPOperation*)unbanUser:(NSString*)userId
                       inRoom:(NSString*)roomId
                      success:(void (^)(void))success
                      failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters

NameTypeDescriptionRequired

userId

NSString

user id

true

roomId

NSString

room id

true

Output Parameters

NameTypeDescriptionRequired

success

block

A block object called when the operation succeeds

true

failure

block

A block object called when the operation fails.

true


The methods below are deprecated. Please avoid using them.

(Deprecated) Create a chat room

client?.createRoom(parameters: params, completion: { response in })

Parameters:

MXRoomCreationParameters

NameTypeDescriptionRequired

type

string

type of login (the type of the above example is m.login.did.identity)

true

updated

string

updated time returned by the pre_login

true

identifier

json

login information

true

device_id

string

device id, not needed for new device

false

Last updated