QNSessions
public class QNSessions
This class provides methods to connect to and logout from the established session against the server.
-
Information about current user
Declaration
Swift
public var user: QNUser? { get } -
Token for current session
Declaration
Swift
public var sessionToken: String? { get } -
True if an active session can be restored
Declaration
Swift
public var canRestoreSession: Bool { get } -
Session identifier for signaling server
Declaration
Swift
public var sessionId: String? { get } -
True when wac server and media server are connected and authenticated
Declaration
Swift
public var isAuthenticated: Bool
-
connect(token:Asynchronous) Connects the session and notify
ClientStateDelegatewhen it finishes, onSuccess is called if it’s all OK or onFailure(ErrorType) if an error occurs.Declaration
Swift
public func connect(token: String) async throwsParameters
tokenToken authentication.
-
restoreSession(withQSS:Asynchronous) Restore an active session that had been activated before. (Call canRestoreSession to check if exist an active session)
Declaration
Swift
public func restoreSession(withQSS: Bool = true) async throws -
disconnect()AsynchronousDestroys the session established against the server.
Declaration
Swift
public func disconnect() async -
Suspend session, should be called when app enters background
Declaration
Swift
public func suspend() -
registerAPNS(_:Asynchronousproduction: ) Register a new push token in server
Declaration
Swift
public func registerAPNS(_ token: String, production: Bool = true) async throwsParameters
tokenToken to save
productionUse production or debug apn gateway
-
Check if a permission is granted in current session
Declaration
Swift
public func isPermissionGranted(_ permission: QNPermission) -> BoolParameters
permissionQNPermission to be checked