Dear community,
since a few days I have the following strange situation.
I have developed an app for iOS which can store data on the Dropbox. The connection is set up as described in the manuals with the right settings in info.plist and the SceneDelegate (see below).
Everything works fine as long as the Dropbox app is not installed on the device. As soon as the Dropbox app is on the device my app doesn't get a connection to the dropbox to exchange data. When launching my app it calls Dropbox to ask if I allow the access of my app. As soon as I confirm this, the return to my app doesn't work properly and the connection breaks. It seems that the DropboxClientsManager.authorizedClient is not properly set.
The error is reproducible - removing Dropbox app: all works, installing Dropbox app: problem is there.
Does anyone have an idea, what I can do to fix it? I would assume that I have to change some settings?
My current settings are:
info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>dbapi-8-emm</string>
<string>dbapi-2</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>db-**************</string>
</array>
</dict>
</array>
and in the sceneDelegate:
// MARK: - Dropbox
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
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)
}
}
Thanks for your support
Regards gcarl