Hi,
I have the same problem as described: The Dropbox window doesn’t close when I click Allow.
I did use the "Handle redirect back into SDK" step implemented in my AppDelegate.swift
and I also implement the handler in SceneDelegate.swift.
In SceneDelegate.swift I got the error „missing argument for parameter 'completion' in call“ when using the func:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let url = URLContexts.first?.url {
print(url)
if let authResult = DropboxClientsManager.handleRedirectURL(url) {
switch authResult {
case .success:
print("Success! User is logged into Dropbox.")
case .cancel:
print("Authorization flow was manually canceled by user!")
case .error(_, let description):
print("Error: \(description)")
}
}
}
}
So I tried to fix it with:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
if let url = URLContexts.first?.url {
print(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))")
}
}
}
}
}
Now the code works, but the window still stays.
Someone know where my problem is?
Thank you!