Start a conversation

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;

Choose files or drag and drop files
Was this article helpful?
  1. Maksym Pidhorbunskyi

  2. Posted
  3. Updated