Knowledgebase: QB Assistance
Is there a method in QuickBlox iOS SDK for checking/storing a valid user session?
Posted by on 06 March 2014 01:16 PM

Is there a method in QuickBlox iOS SDK for checking/storing a valid user session?

Assume you create a session with Facebook login:

QBASessionCreationRequest *extendedAuthRequest = [QBASessionCreationRequest request];
extendedAuthRequest.socialProvider = @"facebook";
extendedAuthRequest.socialProviderAccessToken = @"BAAE74iZBvNR0BAFCnyIIvdbdslDZCbIyzqDtT1oWg4dYYQoUl2tsBGMAZCFJX1x2x0h116OF0rObZC3WwtjjtS9rHiwcsvwvlI4pk0RTObCZAvkfUZCGxatsLykeWmC4";

[QBAuth createSessionWithExtendedRequest:extendedAuthRequest delegate:self];

This session will expire in 2 hours after last request to QuickBlox API. After this you will receive "Required session does not exist" message. In this case the session should be recreated manually (i.e. you will need to repeat the query above).


In order to check the session expiration date you can use the following:

NSDate *sessionExpiratioDate = [QBBaseModule sharedModule].tokenExpirationDate;

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: