You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Bob S.15
8 years agoCollaborator | Level 9
migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?
I am finally getting around to updating my OLD apps from the original Dropbox IOS API to the new one. I'm looking at the migration guide, and the first thing it says is to check my OAuth tokens to se...
Greg-DB
Dropbox Staff
Hi Bob, were you using an official API v1 Dropbox SDK, either the Core SDK or Sync SDK? If so, then yes, your app has OAuth 1 access tokens stored. (Both of those SDKs only used OAuth 1 access tokens.)
If you weren't using an official SDK, the easiest way to check is to see if your access tokens have two pieces (a key and secret) in which case they are OAuth 1 access tokens. If they're just one long string, they're OAuth 2 access tokens.
This old blog post has some helpful code for extracting those old access tokens:
https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/
The API v2 equivalent of /1/oauth2/token_from_oauth1 is /2/auth/token/from_oauth1:
https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1
If you're using the API v2 Objective-C SDK, that's the -tokenFromOauth1:oauth1TokenSecret: method:
https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBAUTHRoutes.html#/c:objc(cs)DBAUTHRoutes(im)tokenFromOauth1:oauth1TokenSecret:
If you weren't using an official SDK, the easiest way to check is to see if your access tokens have two pieces (a key and secret) in which case they are OAuth 1 access tokens. If they're just one long string, they're OAuth 2 access tokens.
This old blog post has some helpful code for extracting those old access tokens:
https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/
The API v2 equivalent of /1/oauth2/token_from_oauth1 is /2/auth/token/from_oauth1:
https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1
If you're using the API v2 Objective-C SDK, that's the -tokenFromOauth1:oauth1TokenSecret: method:
https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBAUTHRoutes.html#/c:objc(cs)DBAUTHRoutes(im)tokenFromOauth1:oauth1TokenSecret:
Bob S.15
8 years agoCollaborator | Level 9
Hey Greg,
My iOS project has a "DropboxSDK.framework" in it, which looks like it is from December 2014. So it is probably OAuth1.
So, where do I find the API v2 Objective-C SDK? Is that link at the end of my post the correct one?
Thanks
Bob
- Greg-DB8 years agoDropbox StaffThe DropboxSDK.framework is the iOS Core SDK, which uses API v1 and OAuth 1 access tokens.
You can find the API v2 Objective-C SDK here:
https://www.dropbox.com/developers/documentation/objective-c - Bob S.158 years agoCollaborator | Level 9
OK thanks -- it says the minimum OS version is iOS 8. Does that mean Dropbox support is going to end for iOS7 devices in June? I'm still supporting older OS versions -- is there a way to use Dropbox API v2 and still do that?
Thanks
Bob
- Greg-DB8 years agoDropbox Staff
The API v2 Objective-C SDK itself supports iOS 8+. If you need to support older versions of iOS, you can either fork the SDK and make the necessary modifications for your use case, or call the HTTP interface for API v2 directly without using the SDK.
- Bob S.158 years agoCollaborator | Level 9
Hey Greg,
When compiling with the new iOS API SDK, I get this XCode warning:
ld: warning: ignoring file /Users/bob/Library/Developer/Xcode/DerivedData/Voxel-feiijazkmmkqehbmctcmaszabhor/Build/Products/Debug-iphoneos/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial, file was built for armv7 which is not the architecture being linked (arm64): /Users/bob/Library/Developer/Xcode/DerivedData/Voxel-feiijazkmmkqehbmctcmaszabhor/Build/Products/Debug-iphoneos/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial
Is there any way to get rid of that?
Thanks,
Bob
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!