<?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: Can't close the page after authentication in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464717#M23751</link>
    <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1366152"&gt;@Edlo11&lt;/a&gt;&amp;nbsp;You seem to be missing some of the relevant code in your fixed version. Make sure you're following &lt;A href="https://github.com/dropbox/SwiftyDropbox#handle-redirect-back-into-sdk" target="_self"&gt;the instructions as currently documented&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please update your code accordingly, and make sure you're using the latest version of the SDK, and let me know if that's still not working.&amp;nbsp;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Oct 2020 14:47:06 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-10-26T14:47:06Z</dc:date>
    <item>
      <title>Re: Can't close the page after authentication</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464378#M23750</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have the same problem as described: The Dropbox window doesn’t close when I click Allow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did use&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;the "Handle redirect back into SDK" step implemented in my&amp;nbsp;AppDelegate.swift&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;and I also implement the handler in&amp;nbsp;SceneDelegate.swift.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SceneDelegate.swift I got the error „missing argument for parameter 'completion' in call“ when using the func:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;func scene(_ scene: UIScene, openURLContexts URLContexts: Set&amp;lt;UIOpenURLContext&amp;gt;) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if let url = URLContexts.first?.url {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(url)
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if let authResult = DropboxClientsManager.handleRedirectURL(url) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch authResult {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .success:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Success! User is logged into Dropbox.")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .cancel:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Authorization flow was manually canceled by user!")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .error(_, let description):
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Error: \(description)")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }&lt;/PRE&gt;
&lt;P&gt;So I tried to fix it with:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp; func scene(_ scene: UIScene, openURLContexts URLContexts: Set&amp;lt;UIOpenURLContext&amp;gt;) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if let url = URLContexts.first?.url {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(url)
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let oauthCompletion: DropboxOAuthCompletion = {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if let authResult = $0 {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch authResult {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .success:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Success! User is logged into DropboxClientsManager.")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .cancel:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Authorization flow was manually canceled by user!")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case .error(_, let description):
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Error: \(String(describing: description))")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }&lt;/PRE&gt;
&lt;P&gt;Now the code works, but the window still stays.&lt;/P&gt;
&lt;P&gt;Someone know where my problem is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 15:05:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464378#M23750</guid>
      <dc:creator>Edlo11</dc:creator>
      <dc:date>2020-10-26T15:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can't close the page after authentication</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464717#M23751</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1366152"&gt;@Edlo11&lt;/a&gt;&amp;nbsp;You seem to be missing some of the relevant code in your fixed version. Make sure you're following &lt;A href="https://github.com/dropbox/SwiftyDropbox#handle-redirect-back-into-sdk" target="_self"&gt;the instructions as currently documented&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please update your code accordingly, and make sure you're using the latest version of the SDK, and let me know if that's still not working.&amp;nbsp;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 14:47:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464717#M23751</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-10-26T14:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can't close the page after authentication</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464787#M23757</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the quick response.&lt;/P&gt;&lt;P&gt;I'm not sure if I understand you correctly, because in the Documentation there is nothing written about the "&lt;SPAN&gt;SceneDelegate.swift". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My "AppDelegate.swift" is the same as in the Documentation. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My "SceneDelegate.swift"&amp;nbsp;is as I have described it before&amp;nbsp;respectively from&amp;nbsp;&lt;A title="iOS, 13.1, url-handler not called #259" href="https://github.com/dropbox/SwiftyDropbox/issues/259" target="_self"&gt;iOS, 13.1, url-handler not called #259&lt;/A&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you mean that I have to add&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt; let canHandleUrl = DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion)
                return canHandleUrl&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;to the&amp;nbsp;"SceneDelegate.swift" ? Then I can't build due to errors.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 17:59:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464787#M23757</guid>
      <dc:creator>Edlo11</dc:creator>
      <dc:date>2020-10-26T17:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't close the page after authentication</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464801#M23758</link>
      <description>&lt;P&gt;Right, you need to make sure you're actually calling&amp;nbsp;handleRedirectURL. (In the code you posted, that was missing.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using scenes, you need to also do this in&amp;nbsp;SceneDelegate.swift. (Apologies that isn't documented yet.) The SDK has changed a bit since the code in that issue was written, but you can do it like this:&lt;/P&gt;
&lt;PRE&gt;    func scene(_ scene: UIScene, openURLContexts URLContexts: Set&amp;lt;UIOpenURLContext&amp;gt;) {
        if let url = URLContexts.first?.url {
            let oauthCompletion: DropboxOAuthCompletion = {
              if let authResult = $0 {
                  switch authResult {
                  case .success:
                      print("Success! User is logged into DropboxClientsManager.")
                  case .cancel:
                      print("Authorization flow was manually canceled by user!")
                  case .error(_, let description):
                      print("Error: \(String(describing: description))")
                  }
              }
            }
            DropboxClientsManager.handleRedirectURL(url, completion: oauthCompletion)
        }
    }&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2020 18:54:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Can-t-close-the-page-after-authentication/m-p/464801#M23758</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-10-26T18:54:17Z</dc:date>
    </item>
  </channel>
</rss>

