User
open class User: NSObject, Codable, Identifiable, Injectable
extension User: Mappable
extension User: NSCopying
extension User: Serializable
The User 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 User
instance, however the connectionStatus and lastSeenAt is valid in User instance
from UserListQuery.
-
Identifier for the user conforming to
IdentifiableDeclaration
Swift
open var id: String -
User ID. This has to be unique.
Declaration
Swift
public let userId: String -
User nickname.
Declaration
Swift
open internal(set) var nickname: String -
Profile image url.
Declaration
Swift
open var profileURL: String? -
Original profile image url.
Declaration
Swift
open var originalProfileURL: String? -
The profile image URL without the
ekey.Since
3.0.194Declaration
Swift
open internal(set) var plainProfileImageURL: String? -
User connection status. This is defined in
UserConnectionStatus.Declaration
Swift
open internal(set) var connectionStatus: UserConnectionStatus -
The lastest time when the user became offline.
Declaration
Swift
open internal(set) var lastSeenAt: Int64 -
Represents the user is activated. This property is changed by the Platform API
Declaration
Swift
public let isActive: Bool -
Discovery key for friend
Declaration
Swift
public let friendDiscoveryKey: String? -
User name for friend
Declaration
Swift
public let friendName: String? -
Shows if the user is a bot or not.
Since
4.9.4Declaration
Swift
public let isBot: Bool -
User’s preferred language. Used for translating messages.
Since
3.0.159Declaration
Swift
open internal(set) var preferredLanguages: [String]? -
Meta data.
Declaration
Swift
open var metaData: [String: String] -
Default constructor.
Declaration
Swift
required public init(from decoder: Decoder) throwsParameters
decoderDecoderinstance -
Encodes this object.
Declaration
Swift
public func encode(to encoder: Encoder) throwsParameters
encoderEncoderinstance -
Initialize with json dictionary
Declaration
Swift
public func initWithDictionary(_ json: [String: Any]) -> Self? -
Converts the object into dictionary
Declaration
Swift
public func _toDictionary() -> [String: Any] -
Creates the meta data for the current user.
Declaration
Swift
func createMetaData( _ metaData: [String: String], completionHandler: MetaDataHandler? )Parameters
metaDataThe meta data to be set.
completionHandlerThe handler block to execute.
metaDatais the meta data which are set on Sendbird server. -
Updates the meta data for the current user.
Declaration
Swift
func updateMetaData( _ metaData: [String: String], completionHandler: MetaDataHandler? )Parameters
metaDataThe meta data to be updated.
completionHandlerThe handler block to execute.
metaDatais the meta counters which are updated on Sendbird server. -
Deletes meta data with key for the current user.
Declaration
Swift
func deleteMetaData(key: String, completionHandler: SBErrorHandler?)Parameters
keyThe key to be deleted.
completionHandlerThe handler block to execute.
-
Deletes all meta data for the current user.
Declaration
Swift
func deleteAllMetaData(completionHandler: SBErrorHandler?)Parameters
completionHandlerThe handler block to execute.
-
Compares this object with given other object.
Declaration
Swift
public override func isEqual(_ object: Any?) -> BoolParameters
objectAnyinstanceReturn Value
trueif same otherwisefalse -
Copies this object
Declaration
Swift
public func copy(with zone: NSZone? = nil) -> AnyParameters
zoneoptional
NSZoneReturn Value
Userinstance -
Serializes this object into data
Declaration
Swift
public func serialize() -> Data?Return Value
optioanal
Datainstance -
Deserializes and reconstructs the object
Declaration
Swift
public class func build(fromSerializedData data: Data?) -> Self?Parameters
dataDatainstanceReturn Value
Userif parameter is valid, otherwisenil
View on GitHub
Install in Dash