How to check whether session live or expired in Qu

2019-03-05 03:35发布

问题:

I know that, any session will be expired after last request (made before 2 hours) to the Quickblox server. When I create a session, I'm able to find [QBBaseModule sharedModule].tokenExpirationDate but I'm not sure how it works and how should I check for whether session is live or expired?

  1. How to check whether session is live or expired?

  2. If I create a session, I'll get [QBBaseModule sharedModule].tokenExpirationDate for next 2 hours, now within an hour I'll made a request to the server, would it update [QBBaseModule sharedModule].tokenExpirationDate date too?

回答1:

  1. By checking tokenExpirationDate.
  2. tokenExpirationDate is updated in every response from QuickBlox. So answer is - yes.