<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203173#M9700</link>
    <description>&lt;P&gt;The SDK handles the access token retrieval and storage for you, so you wouldn't have had to deal with it manually before, but you'll need to extract them in order to hand them off to the new SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the client for the new SDK is concerned, I&amp;nbsp;recommend working through the readme here, which shows how to configure the authorization flow, and get a client for making calls:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#configure-your-project" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#configure-your-project&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2017 23:31:50 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-01-20T23:31:50Z</dc:date>
    <item>
      <title>migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203118#M9684</link>
      <description>&lt;P&gt;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 see if they are version 1 or 2. &amp;nbsp;How do I know which I have?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, the migration guide describes using the "endpoint"&amp;nbsp;/oauth2/token_from_oauth1 to transition old tokens. &amp;nbsp;So, I am coming to this from an ancient time -- what is an "endpoint", and is this 'token_from_oauth1' a function that you call from Objective-C in an iOS app? &amp;nbsp;The documentation page I'm looking at only shows Python, Java, Ruby, and PHP examples, so maybe I'm not looking in the right place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this where I should start? &amp;nbsp;Is there a guide for upgrading an iOS app somewhere?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also is this page current? &amp;nbsp;It dates from March 2016, &amp;nbsp;but then also there is a v1 deprecation warning at the top of it:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/developers-v1/core/sdks/ios" target="_blank"&gt;https://www.dropbox.com/developers-v1/core/sdks/ios&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:26:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203118#M9684</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2019-05-29T09:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203119#M9685</link>
      <description>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.) &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;This old blog post has some helpful code for extracting those old access tokens:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/" target="_blank"&gt;https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The API v2 equivalent of /1/oauth2/token_from_oauth1 is /2/auth/token/from_oauth1:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you're using the API v2 Objective-C SDK, that's the -tokenFromOauth1:oauth1TokenSecret: method:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBAUTHRoutes.html#/c:objc(cs)DBAUTHRoutes(im)tokenFromOauth1:oauth1TokenSecret" target="_blank"&gt;https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBAUTHRoutes.html#/c:objc(cs)DBAUTHRoutes(im)tokenFromOauth1:oauth1TokenSecret&lt;/A&gt;:</description>
      <pubDate>Fri, 20 Jan 2017 18:30:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203119#M9685</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-20T18:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203120#M9686</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My iOS project has a "DropboxSDK.framework" in it, which looks like it is from December 2014. &amp;nbsp;So it is probably OAuth1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, where do I find the API v2 Objective-C SDK? &amp;nbsp;Is that link at the end of my post the correct one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:37:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203120#M9686</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-20T18:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203121#M9687</link>
      <description>The DropboxSDK.framework is the iOS Core SDK, which uses API v1 and OAuth 1 access tokens. &lt;BR /&gt;&lt;BR /&gt;You can find the API v2 Objective-C SDK here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/objective-c" target="_blank"&gt;https://www.dropbox.com/developers/documentation/objective-c&lt;/A&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:38:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203121#M9687</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-20T18:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203123#M9688</link>
      <description>&lt;P&gt;OK thanks -- it says the minimum OS version is iOS 8. &amp;nbsp;Does that mean Dropbox support is going to end for iOS7 devices in June? &amp;nbsp;I'm still supporting older OS versions -- is there a way to use Dropbox API v2 and still do that?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:43:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203123#M9688</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-20T18:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203126#M9689</link>
      <description>&lt;P&gt;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 &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation" target="_self"&gt;HTTP interface for API v2&lt;/A&gt; directly without using the SDK.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 18:46:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203126#M9689</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-20T18:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203161#M9697</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When compiling with the new iOS API SDK, I get this XCode warning:&amp;nbsp;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to get rid of that?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 21:52:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203161#M9697</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-20T21:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203164#M9698</link>
      <description>It sounds maybe like the architecture settings for your app and the pods don't match, or that you don't have arm64 listed in your build architectures. You can configure these in your project's "Build Settings", under "Architectures".</description>
      <pubDate>Fri, 20 Jan 2017 22:07:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203164#M9698</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-20T22:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203167#M9699</link>
      <description>&lt;P&gt;Okay thanks -- I looked at those and that stuff seems to match, but I have bigger problems for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for all the questions. &amp;nbsp;I'm coming to this after several years of not touching this Dropbox code. &amp;nbsp;I'm looking through my project for any reference to an OAuth token and not finding it. &amp;nbsp;It looks like I set up the connection to Dropbox this way:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DBSession* dbSession =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; [[[DBSession alloc]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; initWithAppKey:&lt;/SPAN&gt;&lt;SPAN&gt;@"xxxxxxxxx"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; appSecret:&lt;/SPAN&gt;&lt;SPAN&gt;@"xxxxxxxxx"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; root:kDBRootAppFolder]&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; autorelease];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; [DBSession setSharedSession:dbSession];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and then I use something called the 'restClient' to do all the interaction, like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[restClient createFolder:path];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[restClient uploadFile:filename toPath:toPath fromPath:pngPath];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does that look familiar? &amp;nbsp;How would I go about moving to the new API from this? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 22:20:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203167#M9699</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-20T22:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203173#M9700</link>
      <description>&lt;P&gt;The SDK handles the access token retrieval and storage for you, so you wouldn't have had to deal with it manually before, but you'll need to extract them in order to hand them off to the new SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the client for the new SDK is concerned, I&amp;nbsp;recommend working through the readme here, which shows how to configure the authorization flow, and get a client for making calls:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#configure-your-project" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#configure-your-project&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 23:31:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203173#M9700</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-20T23:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203520#M9721</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I don't really see anything in this Getting Started about tokens or extracting them?&amp;nbsp;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#get-started" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#get-started&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand where these tokens come into it. &amp;nbsp;It seems like if I just follow the authorization flow as described in "Getting Started", it would authorize the app?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: &amp;nbsp;If you saw that earlier post about the 'image not found' error, I fixed that. &amp;nbsp;I didn't have the framework as an embedded binary...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 00:25:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203520#M9721</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-24T00:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203523#M9724</link>
      <description>&lt;P&gt;Hi Bob, yes, if you just follow the getting started guide you linked to, that will have you implement the app authorization flow, allowing users to link to and use your app. That will handle getting new tokens for you and storing them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's only if you were using an old SDK and want to automatically migrate the previously stored access tokens from that in your app would you need to put in the extra work to do so, e.g., using the technique from &lt;A href="https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/" target="_self"&gt;this old blog post&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 00:31:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203523#M9724</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-24T00:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203726#M9758</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have a couple of questions about the regular authorization flow. &amp;nbsp;If I don't have pre-existing tokens, I'm using the web form login to authorize the user. &amp;nbsp; It put up a screen that says "&amp;lt;AppName&amp;gt; would like access to its own folder, Apps-&amp;gt;AppName, inside your Dropbox, Learn More." and you can click Cancel or Allow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I click Allow, instead of returning to the app immediately, it shows a pop-up dialog that says "Open in "AppName"?" and you again have to press Cancel or Open. &amp;nbsp;That seems wrong. &amp;nbsp;Is it really required to do that second dialog or am I doing something wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, once I have done this, how to I get it to remember that it is logged into the app? &amp;nbsp;Currently I have to go through this authorization every time I run the app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 22:18:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203726#M9758</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-24T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203738#M9762</link>
      <description>That "Open in" confirmation is part of iOS itself and was introduced by Apple somewhat recently (either iOS 9 or iOS 10 if I recall correctly) in order to let the user prevent unwanted redirects between apps. Consequently, that is expected, and we don't have control over it.&lt;BR /&gt;&lt;BR /&gt;Also, the SDK should automatically store the authorization for you. Did you finish setting up the authorization flow as documented in the guide? Are you getting any errors?</description>
      <pubDate>Tue, 24 Jan 2017 23:28:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203738#M9762</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-24T23:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203856#M9773</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have the authorization flow set up -- but the Getting Started guide only describes how to authorize the user, it doesn't say anything about handling when the authorization has already happened. &amp;nbsp;By looking at the DBRoulette example, it looks like I should&amp;nbsp;check &amp;nbsp;&lt;SPAN&gt;[DropboxClientsManager authorizedClient], is that right? &amp;nbsp;If that is not nil then the user is already authorized?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My old app used to authorize and then get the user's account info. &amp;nbsp;How would I do that with the new SDK? &amp;nbsp; I see this Account structure here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBUSERSAccount.html" target="_blank"&gt;https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBUSERSAccount.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But it isn't clear how to use the SDK to obtain the information? &amp;nbsp;Is there an example somewhere of how to obtain the account info?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bob&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 17:47:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203856#M9773</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-25T17:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203860#M9775</link>
      <description>&lt;P&gt;Yes, that's right, you should use authorizedClient like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBUSERSRoutes.html#/c:objc(cs)DBUSERSRoutes(im)getCurrentAccount" target="_self"&gt;DBUSERSRoutes.getCurrentAccount&lt;/A&gt; method to get the account information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That would look like this:&lt;/P&gt;
&lt;PRE&gt;[[client.usersRoutes getCurrentAccount] response:^(DBUSERSFullAccount *account, DBNilObject *_, DBRequestError *error) {
    if (account) {
        NSLog(@"%@", account);
    } else if (error) {
        NSLog(@"%@", error);
    }
}];&lt;/PRE&gt;
&lt;P&gt;(Note that&amp;nbsp;DBError was renamed to&amp;nbsp;DBRequestError in 2.0.6, so make sure you use the right one, depending on what version you're using.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 18:02:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203860#M9775</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-25T18:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203868#M9778</link>
      <description>&lt;P&gt;Okay, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I&amp;nbsp;wanted to ask you about retrieving old tokens. &amp;nbsp;Now that I know the user can just re-authorize, it's not that big a deal, but I was trying to get it to work anyway. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My old phone is logged into Dropbox using the old version of the app. &amp;nbsp;Then I run the new version to see if I can convert the old tokens. &amp;nbsp;The new version does not recognize that the user is logged in already, which is expected. &amp;nbsp;Then I call this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NSArray *credentials = [bigApp getTokensFromSyncAPI];&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But [credentials count] always returns 0. &amp;nbsp;Shouldn't it return the old tokens?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bob&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 18:14:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203868#M9778</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-25T18:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203908#M9781</link>
      <description>&lt;P&gt;That code is written for getting tokens from the Sync SDK, but you're using the Core SDK, so the values would be a little different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I put this together for you as a basic concept of how this would work for going from the Core SDK to the API v2 Objective-C SDK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;- (NSArray * )getTokensFromCoreSDK
{
    NSString *keychainPrefix = [[NSBundle mainBundle] bundleIdentifier];
    NSString *keychainId = [NSString stringWithFormat:@"%@.dropbox.auth", keychainPrefix];
    NSDictionary *keychainDict = @{(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword,
                                   (__bridge id)kSecAttrService: keychainId,
                                   (__bridge id)kSecMatchLimit: (__bridge id)kSecMatchLimitOne,
                                   (__bridge id)kSecReturnAttributes: (__bridge id)kCFBooleanTrue,
                                   (__bridge id)kSecReturnData: (__bridge id)kCFBooleanTrue};

    CFDictionaryRef result = NULL;
    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)keychainDict,
                                          (CFTypeRef * )&amp;amp;result);
    NSDictionary *attrDict = (__bridge_transfer NSDictionary * )result;
    NSData *foundValue = [attrDict objectForKey:(__bridge id)kSecValueData];
    NSMutableArray *credentials = [[NSMutableArray alloc] init];

    if (status == noErr &amp;amp;&amp;amp; foundValue) {
        NSDictionary *savedCreds = [NSKeyedUnarchiver unarchiveObjectWithData:foundValue];
        NSArray *credsForApp = [savedCreds objectForKey:@"kDBDropboxUserCredentials"];
        for (NSDictionary *credsForUser in credsForApp) {
            NSDictionary *token = @{
                                    @"userId": [credsForUser objectForKey:@"kDBDropboxUserId"],
                                    @"token": [credsForUser objectForKey:@"kMPOAuthCredentialAccessToken"],
                                    @"tokenSecret": [credsForUser objectForKey:@"kMPOAuthCredentialAccessTokenSecret"]
                                    };
            [credentials addObject:token];
        }
    }
    return credentials;
}

- (void)getAndSaveOAuth2TokensFromRetrievedOAuth1Tokens:(NSArray * )oauth1Tokens
{

    DBTransportClient *transportClient = [[DBTransportClient alloc] initWithAccessToken:nil selectUser:nil userAgent:nil delegateQueue:nil forceForegroundSession:nil appKey:APP_KEY appSecret:APP_SECRET];
    DropboxClient *client = [[DropboxClient alloc] initWithTransportClient:transportClient];

    for (NSDictionary *oauth1Token in oauth1Tokens) {
        [[client.authRoutes tokenFromOauth1:[oauth1Token objectForKey:@"token"] oauth1TokenSecret:[oauth1Token objectForKey:@"tokenSecret"]] response:^(DBAUTHTokenFromOAuth1Result *result, DBAUTHTokenFromOAuth1Error *routeError, DBRequestError *error) {
            if (result) {
                NSLog(@"OAuth 2 access token: %@\n", result.oauth2Token);
                DBAccessToken *accessToken = [[DBAccessToken alloc] initWithAccessToken:result.oauth2Token uid:[oauth1Token objectForKey:@"userId"]];
                [[DBOAuthManager sharedOAuthManager] storeAccessToken:accessToken];
            } else {
                NSLog(@"%@\n%@\n", routeError, error);
            }
        }];
    }

}&lt;/PRE&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;PRE&gt;NSArray *oauth1Tokens = [self getTokensFromCoreSDK];
[self getAndSaveOAuth2TokensFromRetrievedOAuth1Tokens: oauth1Tokens];
&lt;/PRE&gt;
&lt;P&gt;I haven't tested that extensively,&amp;nbsp;so&amp;nbsp;be sure to test it well in your app. I hope it helps though!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 21:49:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203908#M9781</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-25T21:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203914#M9782</link>
      <description>&lt;P&gt;Hey Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; That's great, thanks! &amp;nbsp;That code works, but I think I am missing one step. &amp;nbsp;After I go through and store the new tokens, how do I get it to recognize that it is authorized? &amp;nbsp;I am finding that&amp;nbsp;&lt;SPAN&gt;[DropboxClientsManager authorizedClient] is returning nil after storing the tokens. &amp;nbsp;If I quit the app and then run it again, THEN it recognizes the app as being authorized. &amp;nbsp;But how do I get it to know it's authorized without having to restart the app?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another question if you do not mind. &amp;nbsp;I am making progress with the SDK and have been able to upload files. &amp;nbsp;But I don't understand why some DBFILESRoutes functions list two arguments for the return response, but they seem to require three in practice. &amp;nbsp;For example -createFolder:autorename says it returns a DBFILESFolderMetadata object and a DBFILESCreateFolderError object, but XCode gives me an error unless there is also a third &lt;/SPAN&gt;&lt;SPAN&gt;DBRequestError object. &amp;nbsp;Is this a documentation mistake or is the third argument assumed but not shown for some reason?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 22:34:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203914#M9782</guid>
      <dc:creator>Bob S.15</dc:creator>
      <dc:date>2017-01-25T22:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203919#M9784</link>
      <description>&lt;P&gt;I believe you can get that active within the same session using &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DropboxClientsManager.html#/c:objc(cs)DropboxClientsManager(cm)reauthorizeClient:" target="_self"&gt;DropboxClientsManager.reauthorizeClient&lt;/A&gt;. Let me know if that doesn't work for you though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the third one, a &lt;A href="https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBRequestError.html" target="_self"&gt;DBRequestError&lt;/A&gt;, applies to all calls and covers higher level failures (network issues, invalid access tokens, etc.) so it's not documented on&amp;nbsp;each call individually.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 23:04:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/migrating-from-API-1-to-2-how-do-I-know-if-I-have-OAuth-1-tokens/m-p/203919#M9784</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-25T23:04:49Z</dc:date>
    </item>
  </channel>
</rss>

