MXChatSession Class Reference

Inherits from NSObject
Declared in MXChatSession.h

Overview

The MXChatSession class provides interfaces for detail information about a chat which is represented by a chat instance specified in the initialization method, as well as interacting with it.

  chat

The related chat.

@property (nonatomic, strong, readonly) MXChat *chat

Declared In

MXChatSession.h

  users

An array containing all users of this chat.

@property (nonatomic, strong, readonly, nullable) NSArray<MXUserItem*> *users

Declared In

MXChatSession.h

  emailAddress

Email address of this chat.

@property (nonatomic, strong, readonly) NSString *emailAddress

Declared In

MXChatSession.h

  descriptionString

Descriptions of this chat.

@property (nonatomic, strong, readonly, nullable) NSString *descriptionString

Declared In

MXChatSession.h

  delegate

The object that acts as delegate of the chat session

@property (nonatomic, weak) id<MXChatSessionDelegate> delegate

Declared In

MXChatSession.h

– initWithChat:

Initialize a chat session with specified chat

- (nullable instancetype)initWithChat:(MXChat *)chat

Parameters

chat

The related chat

Return Value

Return a newly initialized chat session. This method will return nil if the chat parameter is not provided.

Declared In

MXChatSession.h

– updateDescripion:withCompletionHandler:

Update description of this chat.

- (void)updateDescripion:(nullable NSString *)description withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

description

New description to be set.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for updating description. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– inviteUsers:withCompletionHandler:

Invite members to join this chat.

- (void)inviteUsers:(NSArray<MXUserItem*> *)users withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

users

An array containing users to be invited.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for inviting users. An error with code MXChatSDKErrorNoPermission will occurred if you do so. When number of users in this chat has reached the upper limit, an error with code MXChatSDKErrorExceedLimit will occurred.

Declared In

MXChatSession.h

– inviteWithOrgId:uniqueIds:completionHandler:

Invite users from an organization by specifying the org id and an array containing unique ids.

- (void)inviteWithOrgId:(nullable NSString *)orgId uniqueIds:(NSArray<NSString*> *)uniqueIds completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

orgId

The id of the org whose users is going to be invited.

uniqueIds

An array containing unique ids of invited users.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for inviting users. An error with code MXChatSDKErrorNoPermission will occurred if you do so. When number of users in this chat has reached the upper limit, an error with code MXChatSDKErrorExceedLimit will occurred.

Declared In

MXChatSession.h

– removeUser:withCompletionHandler:

Remove members from this chat

- (void)removeUser:(MXUserItem *)user withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

user

An array containing members the user is going to remove.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for removing users. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– duplicateChatWithNewName:completionHandler:

Duplicate this chat

- (void)duplicateChatWithNewName:(NSString *)newName completionHandler:(void ( ^ ) ( NSError *_Nullable errorOrNil , MXChat *_Nullable duplicatedChat ))completionHandler

Parameters

newName

The duplication’s new name

completionHandler

A block to be executed when the action completes.

Declared In

MXChatSession.h

– updateUser:withAccessType:completionHandler:

Update a user’s access type.

- (void)updateUser:(MXUserItem *)user withAccessType:(MXChatMemberAccessType)accessType completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

user

The user whose access type will be updated.

accessType

New access type of this user.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for updating users. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– fetchFilesWithFolder:completionHandler:

Fetch files of a folder. If no folder is specified, files in the root directory will be fetched.

- (void)fetchFilesWithFolder:(nullable MXFolderItem *)folder completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSArray<MXFileItem*> *_Nullable files ))completionHandler

Parameters

folder

The folder object whose files will be fetched. Set nil if you want to fetch root files

completionHandler

A block object to be executed when the action completes

Declared In

MXChatSession.h

– fetchFoldersWithFolder:completionHandler:

Fetch sub folders of a folder. If no folder is specified, folders in the root directory will be fetched.

- (void)fetchFoldersWithFolder:(nullable MXFolderItem *)folder completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSArray<MXFolderItem*> *_Nullable folders ))completionHandler

Parameters

folder

The folder object whose sub folders will be fetched. Set nil if you want to fetch root folders

completionHandler

A block object to be executed when the action completes

Declared In

MXChatSession.h

– fetchSignFilesWithCompletionHandler:

Fetch sign files

- (void)fetchSignFilesWithCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSArray<MXSignFileItem*> *_Nullable signFiles ))completionHandler

Parameters

completionHandler

A block object to be executed when the action completes

Declared In

MXChatSession.h

– fetchTodosWithCompletionHandler:

Fetch todos

- (void)fetchTodosWithCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSArray<MXTodoItem*> *_Nullable todos ))completionHandler

Parameters

completionHandler

A block object to be executed when the action completes

Declared In

MXChatSession.h

– markTodo:completed:withCompletionHandler:

Complete or uncomplete a todo.

- (void)markTodo:(MXTodoItem *)todo completed:(BOOL)completed withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

todo

The todo to be marked.

completed

YES if the todo is going to be marked as completed, otherwise NO.

completionHandler

A block object to be executed when the action completes.

Discussion

A user with viewer access type has no permission for completing or uncompleting todos. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– markTodo:flag:completionHandler:

Flag or unflag a todo

- (void)markTodo:(MXTodoItem *)todo flag:(BOOL)flag completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

todo

The todo to be marked

flag

YES if the todo is going to be flagged, otherwise NO

completionHandler

A block object to be executed when the action completes

Discussion

A user with viewer access type has no permission for flagging or unflagging todos. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– deleteTodo:withCompletionHandler:

Delete a Todo

- (void)deleteTodo:(MXTodoItem *)todo withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

todo

Todo to be deleted

completionHandler

A block object to be executed when the action completes

Discussion

A user with viewer access type has no permission for deleting todos. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– declineSignFile:withReason:completionHandler:

Decline to sign a file with some reason.

- (void)declineSignFile:(MXSignFileItem *)signFile withReason:(NSString *)reason completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

signFile

The sign file to be declined.

reason

The decline reason.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for decling sign files. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– deleteFiles:withCompletionHandler:

Delete some files.

- (void)deleteFiles:(NSArray<MXFileItem*> *)files withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

files

An array containing all files to be deleted.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for deleting files. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– deleteFolder:withCompletionHandler:

Delete a folder.

- (void)deleteFolder:(MXFolderItem *)folder withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

folder

The folder to be deleted.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for deleting folders. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– renameFile:withNewName:completionHandler:

Rename a file.

- (void)renameFile:(MXFileItem *)file withNewName:(NSString *)newName completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

file

The file to be renamed.

newName

The new name.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for renaming files. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– renameFolder:withNewName:completionHandler:

Rename a folder.

- (void)renameFolder:(MXFolderItem *)folder withNewName:(NSString *)newName completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

folder

The folder to be renamed.

newName

The new name.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for renaming folders. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– shareFiles:withCompletionHandler:

Share files by getting share and download URLs.

- (void)shareFiles:(NSArray<MXFileItem*> *)files withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSURL *_Nullable shareURL , NSURL *_Nullable downloadURL ))completionHandler

Parameters

files

An array containing files to be shared.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for sharing files. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h

– shareFolders:withCompletionHandler:

Share folders by getting share and download URLs.

- (void)shareFolders:(NSArray<MXFolderItem*> *)folders withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSURL *_Nullable shareURL , NSURL *_Nullable downloadURL ))completionHandler

Parameters

folders

An array containing folders to be shared.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for sharing folders. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChatSession.h