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::

NameTypeDescriptionRequired

displayname

NSString

the new display name

true

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

userId

string

the user ID

True

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

avatarUrl

NSString

the new avatar url

True

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

userId

NSString

the user ID

True

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

userId

NSString

the user id

True

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

userId

NSString

user ID

True

signature

NSString

signature, length <= 100

True

Output Parameters

NameTypeDescriptionRequired

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::

NameTypeDescriptionRequired

userId

NSString

the user id

True

Output Parameters

NameTypeDescriptionRequired

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

NameTypeDescriptionRequired

displayName

string

new nick name

true

(Deprecated) Modify profile image

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

Input Parameters

NameTypeDescriptionRequired

avatarUrl

string

new profile image URL

true

(Deprecated) Query profile information

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

Input Parameters

NameTypeDescriptionRequired

user_id

string

user id

true

Output Parameters

NameTypeDescription

displayname

string

user nickname string

avatar_url

String

user profile image URL string

Last updated