cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

Help migrating from v1 to v2 Objective C

Help migrating from v1 to v2 Objective C

purringpigeon
Explorer | Level 4

Hello,

 

I am not very familiar with Dropbox API, though I got version 1 working just fine on my app.  But I am not really following the path from V1 to V2 all that well.

 

I am attempting to do some very simple things, but find this new API hard to digest I thought I would ask.

 

App Delegate Code went from this:

 

DBSession *dbSession = [[DBSession alloc]
initWithAppKey:@"my key"
appSecret:@"my secret"
root:kDBRootAppFolder]; // either kDBRootAppFolder or kDBRootDropbox
[DBSession setSharedSession:dbSession];

 

To This:

 

[DropboxClientsManager setupWithAppKey:@"my key"];

 

Initially I did the following:

 

 

if ([[DBSession sharedSession] isLinked]) {
  [self.restClient loadMetadata:@"/"];
}

 

I replaced with this:

 

 

if([DropboxClientsManager authorizedClient] != nil ) {
    [[client.filesRoutes getMetadata:@"/"]response:^(DBFILESMetadata * _Nullable result, DBFILESGetMetadataError * _Nullable routeError, DBRequestError * _Nullable error) {}

 

I am not sure if I missed anything, but I can't seem to get back from that, it it always thinks it's not approved in the ios simulator.

 

My original calls are this:

 

[restClient loadMetadata:@"/"];
[restClient uploadFile:fileName toPath:destDir withParentRev:rev fromPath:path];
[restClient loadFile:@"" into:localpath];

 

However after the first link, it doesn't seem to stick...

12 Replies 12

purringpigeon
Explorer | Level 4

So I upgraded my XCODE and was able to debug it - seems the getmeta data was killing me.  

 

I am now able to have my instance cached once set.

opp
New member | Level 2

I am getting the same, disconnect from debugger 30 seconds after i get:

2017-06-05 15:39:08.116 DecadeFiveRecorderPlus[579:16632] -canOpenURL: failed for URL: "dbapi-2://1/connect" - error: "(null)"

2017-06-05 15:39:08.118 DecadeFiveRecorderPlus[579:16632] -canOpenURL: failed for URL: "dbapi-8-emm://1/connect" - error: "(null)"

 

My plist:

<key>CFBundleURLTypes</key>

<array>

<dict>

<key>CFBundleURLName</key>

<string></string>

<key>CFBundleURLSchemes</key>

<array>

<string><another one></string>

<string>db-<app here here></string>

</array>

</dict>

</array>

 

If i install the dropbox app, it launches it for login.

 

Is there some setup on my 6s plus that could be causing it not to launch safari?

Greg-DB
Dropbox Staff

@opp You seem to be getting slightly different output that was previously shared on this thread. I.e., you're getting error: "(null)" which should actually indicate that nothing went wrong with the canOpenURL call.

 

That being the case, please open a new thread with the details (i.e., steps to reproduce, the code, and the version of the SDK you're using) so we can help you with it without spamming anyone else on this old thread.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    opp New member | Level 2
  • User avatar
    purringpigeon Explorer | Level 4
What do Dropbox user levels mean?