SBDUser Class Reference

Inherits from NSObject
Conforms to NSCopying
SBDMappable
Declared in SBDUser.h

Overview

The SBDUser class represents a user. The user is identified by the userId, so the userId has to be unique. The userId, nickname and profileUrl are valid in every SBDUser instance, however the connectionStatus and lastSeenAt is valid in SBDUser instance from SBDUserListQuery.

  userId

User ID. This has to be unique.

@property (strong, nonatomic, readonly, nonnull) NSString *userId

Declared In

SBDUser.h

  nickname

User nickname.

@property (strong, nonatomic, nullable) NSString *nickname

Declared In

SBDUser.h

  profileUrl

Profile image url.

@property (strong, nonatomic, nullable) NSString *profileUrl

Declared In

SBDUser.h

  originalProfileUrl

Original profile image url.

@property (strong, nonatomic, nullable) NSString *originalProfileUrl

Declared In

SBDUser.h

  plainProfileImageUrl

The profile image URL without the ekey.

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

Availability

3.0.194

Declared In

SBDUser.h

  connectionStatus

User connection status. This is defined in SBDUserConnectionStatus.

@property (atomic, readonly) SBDUserConnectionStatus connectionStatus

Declared In

SBDUser.h

  lastSeenAt

The lastest time when the user became offline.

@property (atomic, readonly) long long lastSeenAt

Declared In

SBDUser.h

  isActive

Represents the user is activated. This property is changed by the Platform API

@property (atomic, readonly) BOOL isActive

Declared In

SBDUser.h

  friendDiscoveryKey

@property (strong, nullable) NSString *friendDiscoveryKey

  friendName

@property (strong, nullable) NSString *friendName

  preferredLanguages

User’s preferred language. Used for translating messages.

@property (nonatomic, strong, nullable, readonly) NSArray<NSString*> *preferredLanguages

Availability

3.0.159

Declared In

SBDUser.h

+ buildFromSerializedData:

Builds a user object from serialized data.

+ (nullable instancetype)buildFromSerializedData:(NSData *_Nonnull)data

Parameters

data

Serialized data.

Return Value

SBDUser object.

Declared In

SBDUser.h

– serialize

Serializes a user object.

- (nullable NSData *)serialize

Return Value

Serialized data.

Declared In

SBDUser.h

  metaData

Meta data.

@property (strong, nonatomic, readonly, nullable) NSDictionary<NSString*NSString*> *metaData

Declared In

SBDUser.h

– createMetaData:completionHandler:

Creates the meta data for the current user.

- (void)createMetaData:(NSDictionary<NSString*,NSString*> *_Nonnull)metaData completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSString*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

metaData

The meta data to be set.

completionHandler

The handler block to execute. metaData is the meta data which are set on Sendbird server.

Declared In

SBDUser.h

– updateMetaData:completionHandler:

Updates the meta data for the current user.

- (void)updateMetaData:(NSDictionary<NSString*,NSString*> *_Nonnull)metaData completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSString*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

metaData

The meta data to be updated.

completionHandler

The handler block to execute. metaData is the meta counters which are updated on Sendbird server.

Declared In

SBDUser.h

– deleteMetaDataWithKey:completionHandler:

Deletes meta data with key for the current user.

- (void)deleteMetaDataWithKey:(NSString *_Nonnull)key completionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

key

The key to be deleted.

completionHandler

The handler block to execute.

Declared In

SBDUser.h

– deleteAllMetaDataWithCompletionHandler:

Deletes all meta data for the current user.

- (void)deleteAllMetaDataWithCompletionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to execute.

Declared In

SBDUser.h