简体   繁体   English

如何在Quickblox iOS SDK中检查会话是实时的还是过期的?

[英]How to check whether session live or expired in Quickblox iOS SDK?

I know that, any session will be expired after last request (made before 2 hours) to the Quickblox server. 我知道,任何会话都将在对Quickblox服务器的最后一个请求(在2小时之前发出)之后过期。 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? 创建会话时,我可以找到[QBBaseModule sharedModule].tokenExpirationDate但不确定其工作方式以及如何检查会话是否有效?

  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? 如果创建会话,接下来的2个小时我将获得[QBBaseModule sharedModule].tokenExpirationDate ,现在我将在一个小时内向服务器发出请求,它也会更新[QBBaseModule sharedModule].tokenExpirationDate日期吗?

  1. By checking tokenExpirationDate . 通过检查tokenExpirationDate
  2. tokenExpirationDate is updated in every response from QuickBlox. 在QuickBlox的每个响应中都会更新tokenExpirationDate。 So answer is - yes. 所以答案是-是的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM