Dropbox SDK 401 Error

I use the Dropbox SDK and I configured it so that the application can only access the / Apps / MyAPP folder. I tested it and deleted the folder on the Internet. Now that I am in the application instead of asking for a relink dropbox, it gives me error 401. I do not know why it does not display the view. It worked before I deleted the folder (disabling the application on the Internet). Thank you in advance.

PageFlipper [66893: c07] [WARNING] DropboxSDK: request for error / 1 / metadata / sandbox - the token is invalid. 2012-08-23 03: 10: 12,920 PageFlipper [66893: c07] Error loading metadata: Error Domain = dropbox.com Code = 401 "Operation could not be completed. (Dropbox.com error 401.)" UserInfo = 0x23263fe0 { path = /, error = Token is invalid.}

-(IBAction)addDropBox:(id)sender{ if (![[DBSession sharedSession] isLinked]) { [[DBSession sharedSession] linkFromController:[self parentViewController]]; } [[self restClient] loadMetadata:@"/"]; restClient = nil; }; 
+6
source share
2 answers

I had the same problem. In my case, the problem was that I installed restClient before which was connected to the user. In this case, userId is not set, and the token is invalid.

My recipient for restClient now looks like this:

 - (DBRestClient *)restClient { if (_restClient == nil) { if ( [[DBSession sharedSession].userIds count] ) { _restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]]; _restClient.delegate = self; } } return _restClient; } 
+11
source

I solved the problem by changing the code to the following.

 [[DBSession sharedSession] linkFromController:(UINavigationController *)[[appDelegate window] rootViewController]]; 
0
source

Source: https://habr.com/ru/post/923535/


All Articles