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
-
Add session delegate
Declaration
Swift
public func add(delegate: QNSessionDelegate) -
Remove session delegate
Declaration
Swift
public func remove(delegate: QNSessionDelegate)
-
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, result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
tokenToken authentication.
resultResult with success when actions is completed
-
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, result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
withQSSIndicate if you want to reset the QSS connection as well. True by default.
resultResult with success when actions is completed
-
Destroys the session established against the server.
Declaration
Swift
public func disconnect(result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
resultResult with success when actions is completed
-
Suspend session, should be called when app enters background
Declaration
Swift
public func suspend() -
Register a new push token in server
Declaration
Swift
public func registerAPNS(_ token: String, production: Bool = true, result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
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
QNSessions Class Reference