User

iOS User APIs

Set user display name

- (MXHTTPOperation*)setDisplayName:(NSString*)displayname
                           success:(void (^)(void))success
                           failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters::

Name
Type
Description
Required

displayname

NSString

the new display name

true

Output Parameters

Name
Type
Description
Required

success

A block object

A block object called when the operation succeeds.

true

failure

A block object

A block object called when the operation fails.

true

Get the display name of a user

- (MXHTTPOperation*)profileForUser:(NSString*)userId
                           success:(void (^)(NSString *displayName, NSString *avatarUrl))success
                           failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters::

Name
Type
Description
Required

userId

string

the user ID

True

Output Parameters

Name
Type
Description
Required

displayName

NSString

user display name

true

avatarUrl

NSString

url of the profile image

true

Set user avatar

Set the user's profile image url. The user must have previously logged into SendingNetwork.

- (MXHTTPOperation*)setAvatarUrl:(NSString*)avatarUrl
                         success:(void (^)(void))success
                         failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters::

Name
Type
Description
Required

avatarUrl

NSString

the new avatar url

True

Output Parameters

Name
Type
Description
Required

success

A block object

A block object called when the operation succeeds

true

failure

A block object

A block object called when the operation fails

true

Get the avatar url of a user

- (MXHTTPOperation*)avatarUrlForUser:(NSString*)userId
                             success:(void (^)(NSString *avatarUrl))success
                             failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters::

Name
Type
Description
Required

userId

NSString

the user ID

True

Output Parameters

Name
Type
Description
Required

success

block

A block object called when the operation succeeds. It provides the user avatar url.

true

failure

block

A block object called when the operation fails.

true

Get the profile information of a user

- (MXHTTPOperation*)profileForUser:(NSString*)userId
                           success:(void (^)(NSString *displayName, NSString *avatarUrl))success
                           failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT;

Input Parameters::

Name
Type
Description
Required

userId

NSString

the user id

True

Output Parameters

Name
Type
Description
Required

success

NSString

A block object called when the operation succeeds. It provides the user display name and avatar url.

true

failure

NSString

A block object called when the operation fails.

true

Set signature for a user

- (MXHTTPOperation*)setSignatureWithUserId:(NSString *)userId
                                 signature:(NSString *)signature
                                   success:(void (^)(void))success
                                   failure:(void (^)(NSError *error))failure

Input Parameters::

Name
Type
Description
Required

userId

NSString

user ID

True

signature

NSString

signature, length <= 100

True

Output Parameters

Name
Type
Description
Required

success

block

success description

true

failure

block

failure description

true

Get signature of a user

- (MXHTTPOperation*)getSignatureWithUserId:(NSString *)userId
                                   success:(void (^)(NSString * signature))success
                                   failure:(void (^)(NSError *error))failure;

Input Parameters::

Name
Type
Description
Required

userId

NSString

the user id

True

Output Parameters

Name
Type
Description
Required

success

block

(void (^)(NSString * signature))success

true

failure

block

failure description

true


The APIs below are deprecated. Please avoid using them.

(Deprecated) Modify nickname

client?.setDisplayName(displayName, completion: { response in })

Input Parameters

Name
Type
Description
Required

displayName

string

new nick name

true

(Deprecated) Modify profile image

client?.setAvatarUrl(URL.init(string: avatarUrl), completion: { response in })

Input Parameters

Name
Type
Description
Required

avatarUrl

string

new profile image URL

true

(Deprecated) Query profile information

client?.profile(forUser: user_id, completion: { response in })

Input Parameters

Name
Type
Description
Required

user_id

string

user id

true

Output Parameters

Name
Type
Description

displayname

string

user nickname string

avatar_url

String

user profile image URL string

Last updated