Contact

iOS Contact APIS

Get contact list

- (MXHTTPOperation*)getContactsListWithUserId:(NSString *)userId
                                      success:(void (^)(MXContactsListResponse *contactsListResponse))success
                                      failure:(void (^)(NSError *error))failure;

Input Parameters:

Name
Type
Description
Required

user_id

NSString

user id string

true

Output Parameters

MXContactsListResponse

Add user as a contact

- (MXHTTPOperation*)addToFavoritesWithUserId:(NSString *)userId
                                   contactId:(NSString *)contactId
                                        tags:(NSArray*)tags
                                     isRoom:(BOOL)isRoom
                                     success:(void (^)(void))success
                                     failure:(void (^)(NSError *error))failure;

Input Parameters:

Name
Type
Description
Required

userId

NSString

user id string

true

contactId

NSString

contact id string

true

tags

NSArray

tags NSArray

false

isRoom

bool

whether is a direct message

true

Remove contact

- (MXHTTPOperation*)deleteFavoritesWithUserId:(NSString *)userId
                                   contactId:(NSString *)contactId
                                     isRoom:(BOOL)isRoom
                                     success:(void (^)(void))success
                                      failure:(void (^)(NSError *error))failure;

Input Parameters:

Name
Type
Description
Required

userId

NSString

user id string

true

contactId

NSString

contact id string

True

isRoom

BOOL

whether is a direct message

True

Output Parameters

Name
Type
Description
Required

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) Get contact list

client?.getContactsList(withUserId: user_id, success: { <#MXContactsListResponse?#> in }, failure: <#T##((Error?) -> Void)!##((Error?) -> Void)!##(Error?) -> Void#>)

Parameters:

Name
Type
Description
Required

user_id

string

user id string

true

Returns

MXContactsListResponse

(Deprecated) Add user as a contact

client?.addToFavorites(withUserId: user_id, contactId: contactId, isRoom: true, success: {}, failure: { error in })

Parameters:

Name
Type
Description
Required

user_id

string

user id string

true

contactId

string

contact id string

true

isRoom

bool

whether is a direct message

true

(Deprecated) Remove contact

client?.deleteFavorites(withUserId: user_id, contactId: contactId, isRoom: true, success: {}, failure: { error in })

Parameters:

Name
Type
Description
Required

user_id

string

user id string

true

contactId

string

contact id string

True

isRoom

bool

whether is a direct message

True

Last updated