cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API for iOS

API for iOS

sipho
Explorer | Level 3

Dropbox doesnt authenticate successfully when dropbox app is installed on your device.

 

I'm using DropBox SDK for iOS.

 

After allowing the DropBox app to authenticate my app, the screen goes blank - but i log in succeesfully when I dont have dropbox app installed in my device.

4 Replies 4

Greg-DB
Dropbox Staff
I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

- the name and version of the platform and SDK/library you are using
- the full text of any error or output, or a screenshot showing the issue
- the steps to reproduce the issue
- the relevant code snippet(s)

sipho
Explorer | Level 3
Hi Greg,

Thank you for your quick reply.

I'm developing an app that I want to use to access files from Original Dropbox App from my app.

Ive managed to successfully get authorized by the Original Dropbox webview, but when I install the Original Dropbox in my device - It opens the Original Dropbox app for authorization and after allowing it to authorize, the screen goes blank and app delegate method is not triggered. Below is my code.

//Login method
- (void) viewDidLoad {
DBSession *dbSession = [[DBSession alloc] initWithAppKey:kDBAppKey
appSecret:kDBAppSecret
root:kDBRootDropbox];
[DBSession setSharedSession:dbSession];

if (![[DBSession sharedSession] isLinked]) {

[[DBSession sharedSession] linkFromController:self];
} else {

[self showActivityHud:@"Retrieving files from DropBox..."];
[[self restClient] loadMetadata:@"/"];
}
}

//AppDelegate method that is not triggered ONLY if the Original Dropbox app is installed in my device.
- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

if ([[DBSession sharedSession] handleOpenURL:url]) {

if ([[DBSession sharedSession] isLinked]) {

NSLog(@"App linked successfully");

[[NSNotificationCenter defaultCenter] postNotificationName:@"getDropboxRoot" object:self];
_isDropBoxCancelled = NO;
} else if ([[url absoluteString] containsString:@"cancel"]){

[[DBSession sharedSession] linkFromController:nil];

[[NSNotificationCenter defaultCenter] postNotificationName:@"dropboxRegistrationCancel" object:self];
_isDropBoxCancelled = YES;
}
}
}

//In simple terms...My Simulator works perfect because it doesnt have Original Dropbox app installed in it.

//My iPhone doesnt work since there is Original DropBox app installed.

Thank you.

sipho
Explorer | Level 3
Hi Greg,

I fixed the problem.

I changed LSApplicationQueriesSchemes to dpapi-1. Then it worked.

Thank you for your time man. I appreciate it.

Greg-DB
Dropbox Staff

I'm glad to hear you already sorted this out.

 

Based on your code though, it looks like you're using the old iOS Core SDK for the deprecated API v1, which is being retired later this year. You should instead use the API v2 Objective-C SDK.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    sipho Explorer | Level 3
What do Dropbox user levels mean?