简体   繁体   中英

how to keep session in android for further usage in quickblox

This question and its answers are not clear in this context.

Do we have to create session every time we open application? For example, try to login with facebook, use application, then close.

What will be happen if user comes back and opens application again? Quickblox session lasts 2 hours i know, i think i dont have to authenticate with quickblox again and i can use created session object, therefore i can skip authentication process. How can i force api to use my stored session?

Because i think if i have to request again, i have to sign in my user again for changing api usage level, so each time user opens application i will send 2 requests for that process.

Am i missing something in concepts or is there an easy way to handle this situation?

Thanks in advance.

After successful login you can use QuickBlox for 2 hours. If you want to continue using QB session without logining once again you can make some request to QuickBlox BEFORE the end of the session. After it you'll have extra hours. If you need to continue this current login session - repeat it once again. For instance, use method that in 1 hour 50 minutes will send some request or create new session and re-write the token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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