<?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 checkAndPerformV1TokenMigration in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/checkAndPerformV1TokenMigration/m-p/218657#M11490</link>
    <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I add a fuction with named checkAndPerformV1TokenMigration as following :&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;-(void)performDropboxMigrationFromV1ToV2
{
  BOOL willPerformMigration = [DBClientsManager checkAndPerformV1TokenMigration:^(BOOL shouldRetry, BOOL invalidAppKeyOrSecret,
                                                                                  NSArray&amp;lt;NSArray&amp;lt;NSString *&amp;gt; *&amp;gt; *unsuccessfullyMigratedTokenData) {
    if (invalidAppKeyOrSecret) {
      // Developers should ensure that the appropriate app key and secret are being supplied.
      // If your app has multiple app keys / secrets, then run this migration method for
      // each app key / secret combination, and ignore this boolean.
    }
    
    if (shouldRetry) {
      // Store this BOOL somewhere to retry when network connection has returned
    }
    
    if ([unsuccessfullyMigratedTokenData count] != 0) {
      NSLog(@"The following tokens were unsucessfully migrated:");
      for (NSArray&amp;lt;NSString *&amp;gt; *tokenData in unsuccessfullyMigratedTokenData) {
        NSLog(@"DropboxUserID: %@, AccessToken: %@, AccessTokenSecret: %@, StoredAppKey: %@", tokenData[0],
              tokenData[1], tokenData[2], tokenData[3]);
      }
    }
    
    if (!invalidAppKeyOrSecret &amp;amp;&amp;amp; !shouldRetry &amp;amp;&amp;amp; [unsuccessfullyMigratedTokenData count] == 0) {
      [DBClientsManager setupWithAppKey:DROPBOX_APP_KEY];
    }
  } queue:nil appKey:DROPBOX_APP_KEY appSecret:DROPBOX_APP_SECRET];
  
  if (!willPerformMigration) {
    [DBClientsManager setupWithAppKey:DROPBOX_APP_KEY];
  }
}&lt;BR /&gt;&lt;BR /&gt;- (&lt;SPAN class="pl-c1"&gt;BOOL&lt;/SPAN&gt;)application:(UIApplication *)application didFinishLaunchingWithOptions:(&lt;SPAN class="pl-c1"&gt;NSDictionary&lt;/SPAN&gt; *)launchOptions { &lt;BR /&gt;  [self performDropboxMigrationFromV1ToV2];&lt;BR /&gt;&lt;BR /&gt;  // Do I still need add following line code: &lt;BR /&gt;  // [DBClientsManager &lt;SPAN class="pl-c1"&gt;setupWithAppKey:&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;@"&lt;/SPAN&gt;&amp;lt;APP_KEY&amp;gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;]; ??&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="pl-k"&gt;  return&lt;/SPAN&gt; &lt;SPAN class="pl-c1"&gt;YES&lt;/SPAN&gt;; &lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I perform the function &amp;nbsp;in didFinishLaunchWithOption function but after taht.&lt;/P&gt;&lt;P&gt;Do I still need add&amp;nbsp;[DBClientsManager setupWithAppKey:@"&amp;lt;APP_KEY&amp;gt;"] in&lt;SPAN&gt;didFinishLaunchWithOption ??&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:23:08 GMT</pubDate>
    <dc:creator>timeflying</dc:creator>
    <dc:date>2019-05-29T09:23:08Z</dc:date>
    <item>
      <title>checkAndPerformV1TokenMigration</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/checkAndPerformV1TokenMigration/m-p/218657#M11490</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I add a fuction with named checkAndPerformV1TokenMigration as following :&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;-(void)performDropboxMigrationFromV1ToV2
{
  BOOL willPerformMigration = [DBClientsManager checkAndPerformV1TokenMigration:^(BOOL shouldRetry, BOOL invalidAppKeyOrSecret,
                                                                                  NSArray&amp;lt;NSArray&amp;lt;NSString *&amp;gt; *&amp;gt; *unsuccessfullyMigratedTokenData) {
    if (invalidAppKeyOrSecret) {
      // Developers should ensure that the appropriate app key and secret are being supplied.
      // If your app has multiple app keys / secrets, then run this migration method for
      // each app key / secret combination, and ignore this boolean.
    }
    
    if (shouldRetry) {
      // Store this BOOL somewhere to retry when network connection has returned
    }
    
    if ([unsuccessfullyMigratedTokenData count] != 0) {
      NSLog(@"The following tokens were unsucessfully migrated:");
      for (NSArray&amp;lt;NSString *&amp;gt; *tokenData in unsuccessfullyMigratedTokenData) {
        NSLog(@"DropboxUserID: %@, AccessToken: %@, AccessTokenSecret: %@, StoredAppKey: %@", tokenData[0],
              tokenData[1], tokenData[2], tokenData[3]);
      }
    }
    
    if (!invalidAppKeyOrSecret &amp;amp;&amp;amp; !shouldRetry &amp;amp;&amp;amp; [unsuccessfullyMigratedTokenData count] == 0) {
      [DBClientsManager setupWithAppKey:DROPBOX_APP_KEY];
    }
  } queue:nil appKey:DROPBOX_APP_KEY appSecret:DROPBOX_APP_SECRET];
  
  if (!willPerformMigration) {
    [DBClientsManager setupWithAppKey:DROPBOX_APP_KEY];
  }
}&lt;BR /&gt;&lt;BR /&gt;- (&lt;SPAN class="pl-c1"&gt;BOOL&lt;/SPAN&gt;)application:(UIApplication *)application didFinishLaunchingWithOptions:(&lt;SPAN class="pl-c1"&gt;NSDictionary&lt;/SPAN&gt; *)launchOptions { &lt;BR /&gt;  [self performDropboxMigrationFromV1ToV2];&lt;BR /&gt;&lt;BR /&gt;  // Do I still need add following line code: &lt;BR /&gt;  // [DBClientsManager &lt;SPAN class="pl-c1"&gt;setupWithAppKey:&lt;/SPAN&gt;&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;@"&lt;/SPAN&gt;&amp;lt;APP_KEY&amp;gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;]; ??&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="pl-k"&gt;  return&lt;/SPAN&gt; &lt;SPAN class="pl-c1"&gt;YES&lt;/SPAN&gt;; &lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I perform the function &amp;nbsp;in didFinishLaunchWithOption function but after taht.&lt;/P&gt;&lt;P&gt;Do I still need add&amp;nbsp;[DBClientsManager setupWithAppKey:@"&amp;lt;APP_KEY&amp;gt;"] in&lt;SPAN&gt;didFinishLaunchWithOption ??&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:23:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/checkAndPerformV1TokenMigration/m-p/218657#M11490</guid>
      <dc:creator>timeflying</dc:creator>
      <dc:date>2019-05-29T09:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: checkAndPerformV1TokenMigration</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/checkAndPerformV1TokenMigration/m-p/218797#M11505</link>
      <description>No, looking at the code you have, you don't need to also call it in didFinishLaunchingWithOptions.&lt;BR /&gt;&lt;BR /&gt;For reference, whether or not you're running the checkAndPerformV1TokenMigration method, you need to make sure you call setupWithAppKey once. &lt;BR /&gt;&lt;BR /&gt;If you're not using the migration, you can just call setupWithAppKey in didFinishLaunchingWithOptions.&lt;BR /&gt;&lt;BR /&gt;If you are using the migration, as you are, the code you have will already make sure setupWithAppKey is called once, either at the end of the successful or failed migration, so you don't need to additionally call elsewhere.</description>
      <pubDate>Mon, 01 May 2017 19:08:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/checkAndPerformV1TokenMigration/m-p/218797#M11505</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-05-01T19:08:35Z</dc:date>
    </item>
  </channel>
</rss>

