Problem Description
When using SwiftyDropbox version 10.2.3 in an iOS app (minimum deployment target: iOS 13.0, UIKit, Swift), I encountered issues with DropboxClientsManager.authorizeFromControllerV2 regarding the includeGrantedScopes parameter in scopeRequest.
Reproduction Steps
Case 1: includeGrantedScopes: true
DropboxClientsManager.authorizeFromControllerV2(
UIApplication.shared,
controller: viewController,
loadingStatusDelegate: loadingDelegate,
openURL: { url in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
},
scopeRequest: .init(scopeType: .user, scopes: [], includeGrantedScopes: true)
)
This configuration results in a web error:
Case 2: includeGrantedScopes: false
DropboxClientsManager.authorizeFromControllerV2(
UIApplication.shared,
controller: viewController,
loadingStatusDelegate: loadingDelegate,
openURL: { url in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
},
scopeRequest: .init(scopeType: .user, scopes: [], includeGrantedScopes: false)
)
This causes a crash with the following error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SwiftyDropbox.LoadingViewController 0x15607a400> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loadingImageView.'
Environment
- SwiftyDropbox version: 10.2.3
- iOS version: 13.0+
- Swift: 5.0
- UIKit used
Expected Behavior
- Both usages should not cause server errors or application crashes.
Actual Behavior
- Usage with
includeGrantedScopes: true results in a 500 error (see screenshot attached).
- Usage with
includeGrantedScopes: false crashes the app due to an NSUnknownKeyException related to loadingImageView in LoadingViewController.
Additional Notes
- The issues are consistently reproducible with the steps above.
- Please advise if there are recommended workarounds or if additional debug info is needed.
- if I use the deprecated APIs everything works fine:
DropboxClientsManager.authorizeFromController(
UIApplication.shared, controller: viewController
) { url in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
Problem Description
When using SwiftyDropbox version 10.2.3 in an iOS app (minimum deployment target: iOS 13.0, UIKit, Swift), I encountered issues with
DropboxClientsManager.authorizeFromControllerV2regarding theincludeGrantedScopesparameter inscopeRequest.Reproduction Steps
Case 1:
includeGrantedScopes: trueThis configuration results in a web error:
Case 2:
includeGrantedScopes: falseThis causes a crash with the following error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SwiftyDropbox.LoadingViewController 0x15607a400> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loadingImageView.'Environment
Expected Behavior
Actual Behavior
includeGrantedScopes: trueresults in a 500 error (see screenshot attached).includeGrantedScopes: falsecrashes the app due to anNSUnknownKeyExceptionrelated toloadingImageViewinLoadingViewController.Additional Notes