Session
@available(iOS 12.0, *)
@objc(BDKSession)
public class Session : NSObject
An object representing the session of user in the Kaleyra Video SDK.
You create a Session
object when you want the Kaleyra Video SDK to connect to the Kaleyra Video platform.
You are required to provide the userId
of the user you want to connect to Kaleyra Video and a component conforming to the
AccessTokenProvider
protocol the SDK will use when it needs an access token for the user.
If you want to be informed of Session
state changes you can provide an object conforming to the SessionObserver
protocol in the object initialiser.
-
The userId of the user this session belongs to.
Declaration
Swift
@objc public let userId: String
-
Creates a new session for the user provided as first parameter.
Remark
This initialiser is suited for
Swift
code only. If you need to create a new session inObjective-c
call theinit(userId:tokenProvider:observer:)
method insteadDeclaration
Swift
public init(userId: String, tokenProvider: AccessTokenProvider, observer: SessionObserver? = nil)
-
Creates a new session for the user provided as first parameter.
Remark
This initialiser is suited for
Objective-c
code. If you need to create a new session inSwift
call theinit(userId:tokenProvider:observer:)
method insteadDeclaration
Swift
@objc public convenience init(userId: String, tokenProvider: AccessTokenProviderObjc, observer: SessionObserver? = nil)