Inherits from NSObject
Conforms to NSCoding
Declared in QBSession.h

Overview

QBSession class interface. This class represents session information.

Tasks

Properties

currentUser

@property (nonatomic, readonly, nullable) QBUUser *currentUser
Discussion

Session user

Declared In

QBSession.h

sessionDetails

@property (nonatomic, readonly, nullable) QBASession *sessionDetails
Discussion

Session details

Declared In

QBSession.h

sessionExpirationDate

@property (nonatomic, readonly, nullable) NSDate *sessionExpirationDate
Discussion

Session expiration date

Declared In

QBSession.h

tokenValid

@property (nonatomic, readonly, getter=isTokenValid) BOOL tokenValid
Discussion

Token valid state

Declared In

QBSession.h

Class Methods

currentSession

+ (QBSession *)currentSession
Discussion

Current session instance.

Return Value

QBSession instance.

Declared In

QBSession.h

Instance Methods

startSessionWithDetails:

- (void)startSessionWithDetails:(QBASession *)session
Discussion

Start updated session with details Use this method to update session details

Note: updateSessionBlock block executes synchronously on background thread and you are allowed to execute synchronous URL request and to block a background thread from executing until you receive updated credentials

Note: call this method after first session start with startSessionWithDetails:updateSessionBlock:

Note: updateSessionBlock must be already set

Parameters

session

QBAsession instance with updated credentials

Declared In

QBSession.h

startSessionWithDetails:expirationDate:

- (void)startSessionWithDetails:(QBASession *)session expirationDate:(NSDate *)sessionDate
Discussion

Start session with details

Parameters

session

QBASession instance, token, applicationID, userID are required fields

sessionDate

expiration date

Declared In

QBSession.h

startSessionWithDetails:updateSessionBlock:

- (void)startSessionWithDetails:(QBASession *)session updateSessionBlock:(dispatch_block_t)updateSessionBlock
Discussion

Start session with details Disables auto create session

Note: updateSessionBlock executes synchronously on background thread and you are allowed to execute synchronous URL request and to block a background thread from executing until you receive updated credentials

Note: by the end of updateSessionBlock you should call startSessionWithDetails: with updated credentials

Parameters

session

QBAsession instance

updateSessionBlock

updateSessionBlock before the end of this block you should call startSessionWithDetails:

Declared In

QBSession.h