cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more 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: 

Integration to Dropbox suddenly failing

Integration to Dropbox suddenly failing

purringpigeon
Explorer | Level 4
Go to solution

I have a simple app that uploads a set of files to Dropbox as a back up - been working fine on V2 for years now it fails. Token is expired apparently.

 

I updated my cocoa pod today - but that brought more errors - Xcode fail to build, but the errors disappear and I have no idea what is broken.

 

I noticed the DropboxClientsManager was renamed, but that was the only error that was present in the project - updated from 2.0.6 to 3.0.15 - and it's all a mess - any guide i can use to fix this.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

It looks like that's an error from CocoaPods itself so I can't really offer support for that, but it looks like there's a post about that error here.

View solution in original post

7 Replies 7

Greg-DB
Dropbox Staff
Go to solution

Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here.

Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation.

For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.

While the change began on September 30th 2021, we released it gradually, so you may not have seen your app(s) affected until more recently. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.

 

The official Dropbox SDKs can handle the refresh process for you as long as you use a relatively recent version. For example, based on the version numbers you shared, it sounds like you're using the Dropbox Objective-C SDK. Support for short-lived access tokens/refresh tokens was introduced to that in v5.0.2 in August 2020. You can find the release history which indicates what changed for each release here. For example, as you mentioned, DropboxClientsManager was renamed in v3.0.0.

 

The latest version is currently v7.0.0. As long as you use the authorization flow with authorizeFromControllerV2 as documented, it will handle short-lived access tokens and the refresh process for you automatically.

 

I'm not sure what you mean by "but the errors disappear" though. That sounds like it may be an issue with Xcode itself, so you may need to refer to the resources for Xcode for help with that.

purringpigeon
Explorer | Level 4
Go to solution

Thank you - that makes sense - it only happens to people who are upgrading phones and have to relink their account then it works for a couple of hours, then dies.

 

I did a pod update today and only got to 3.0.15 - I am not seeing how to get anything later and the method you indicate authorizeFromControllerV2 is not there - is there a way to force going up to the 5.X as you mentioned?

 

Thanks.

Greg-DB
Dropbox Staff
Go to solution

That should be controlled by your Podfile. For instance, v3.0.16 dropped iOS 8, so if you're still specifying support for iOS 8 in your Podfile, Cocoapods wouldn't upgrade you past that.

purringpigeon
Explorer | Level 4
Go to solution
Thanks again - I haven’t done much with pods so this is causing me trouble and appreciate the help.

I tried changing the iOS level in the pod file to 11.0, 15.0, 16.0 and it fails saying no version found based on this: https://github.com/dropbox/dropbox-sdk-obj-c/releases

Is there a trick to make that work? I’ll keep poking at it but appreciate any tips.

purringpigeon
Explorer | Level 4
Go to solution

I can't seem to upgrade to the latest version...

 

### Podfile

```ruby
platform :ios, '11.0'
use_frameworks!

target 'ServiceReport' do
    pod 'ObjectiveDropboxOfficial'
end
```

### Error

```
RuntimeError - [Xcodeproj] Unknown object version.

 I am running an M2 MacBook Air if that matters 

Greg-DB
Dropbox Staff
Go to solution

It looks like that's an error from CocoaPods itself so I can't really offer support for that, but it looks like there's a post about that error here.

purringpigeon
Explorer | Level 4
Go to solution

That worked - thanks

Need more support?
Who's talking

Top contributors to this post

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