QNPresencesRepository
public class QNPresencesRepository
Service to manage presence actions and subscribe to presence events
-
subscribe(to:Asynchronous) Subscribe and Get contact’s presence
Declaration
Swift
public func subscribe(to contact: QNContact) async throws -> QNPresenceParameters
contactContact to subscribe
-
subscribe(to:Asynchronous) Subscribe and Get contact’s presences
Declaration
Swift
public func subscribe(to contacts: [QNContact]) async throws -> [QNPresence]Parameters
contactsList of contacts to subscribe
-
getPresence(for:AsynchronousfromCache: ) Get user’s presence
Declaration
Swift
public func getPresence(for user: QNUser, fromCache: Bool = true) async throws -> QNPresenceParameters
userUser to get presence
fromCacheRetrieve from cache or server; true by default
resultResult with the presence
-
getPresence(_:AsynchronousfromCache: ) Get user’s presence
Declaration
Swift
public func getPresence(_ identifier: String, fromCache: Bool = true) async throws -> QNPresenceParameters
identifieridentifier of the user’s presence you want to obtain. It can be either the username@domain, or the userID
fromCacheRetrieve from cache or server; true by default
resultResult with the presence
-
getOwnPresence()AsynchronousGet current user presence
Declaration
Swift
public func getOwnPresence() async throws -> QNPresence -
updateOwnStatus(_:Asynchronous) Update current user status
Declaration
Swift
public func updateOwnStatus(_ status: QNPresence.Status) async throws -> QNPresenceParameters
statusStatus to update
-
updateOwnDisplayName(_:Asynchronous) Update current user displayName
Declaration
Swift
public func updateOwnDisplayName(_ displayName: String) async throws -> QNPresenceParameters
displayNameDisplayName to update
-
updateOwnAvatar(_:Asynchronous) Update current user avatar
Declaration
Swift
public func updateOwnAvatar(_ avatar: String?) async throws -> QNPresenceParameters
avatarBase64 avatar to update. Send a not-empty string to upload a new avatar, and null to remove the current one.
-
updateOwnPresence(_:Asynchronous) Update current user presence
Declaration
Swift
public func updateOwnPresence(_ presence: QNPresenceUpdateRequest) async throws -> QNPresenceParameters
presencePresence to update
resultResult with the presence updated
-
getUser(_:Asynchronous) Get user
Declaration
Swift
public func getUser(_ identifier: String) async throws -> QNUserParameters
identifieridentifier of the user you want to obtain. It can be either the username@domain, or the userID
Return Value
User or QNSDKError
-
getOwnUser()AsynchronousGet current user
Declaration
Swift
public func getOwnUser() async throws -> QNUserReturn Value
User or QNSDKError