Reputation: 542
Currently I'm planning to add Box storage support in my app, and would like to know if it's possible to retain the authentication.
I've read the documentation present in the github page about the Authentication but found nothing about a possibility to check wether or not the user has been already looged into Box services ! The documentation seems to tell that the app must authenticate the user and logged him out everytime an operation is done (may be I'm wrong !).
So my question is does there is a way to check this, and so don't force the user to reiterate the authentication process ?
Thanks in advance for your help !
EDIT : can't we just check the array count of
NSArray *boxUsers = [BOXContentClient users];
?
My idea is if it return 0, launch the authentication process, but if it is more than 0, launch the upload process !
Upvotes: 0
Views: 133
Reputation: 991
Your idea of checking the static 'boxUsers' array count is correct and you could go with that. Another way would be to check if the 'user' on a particular client is nil. e.g.
if ([[BOXContentClient defaultClient] user] != nil) {
// You have a logged in user.
}
We tend to use the second approach internally at Box, but either one is correct and both are considered to be public contracts from the SDK's perspective.
Upvotes: 2