You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Fleaurent
4 years agoExplorer | Level 4
SwiftyDropbox SwiftUI iOS
Hey all,
I've tried to add the SwiftyDropbox package into my SwiftUI iOS project and followed the GitHub readme:
I updated the following files as recommended using my app key:
- Info.plist...
Fleaurent
Explorer | Level 4
I found the following issue regarding SwiftyDropbox and SwiftUI:
I just removed the ScrollView which made Problems, and it seems to work:
struct ContentView : View {
@State var isShown = false
var body : some View {
VStack {
Text("HI!")
Button(action: {
self.isShown.toggle()
}) {
Text("Dropbox....")
}
DropboxView(isShown: $isShown)
}
}
}
struct DropboxView: UIViewControllerRepresentable {
typealias UIViewControllerType = UIViewController
@Binding var isShown : Bool
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
if isShown {
DropboxClientsManager.authorizeFromController(UIApplication.shared,
controller: uiViewController,
openURL: { (url: URL) -> Void in
UIApplication.shared.open(url, options: [:], completionHandler: nil)
})
}
}
func makeUIViewController(context _: Self.Context) -> UIViewController {
return UIViewController()
}
}
--> the authorisation page of Dropbox opens and I can enter my credentials.
My next Problem: when I check the DropcoxClientsManager afterwards, it still contains nil
if DropboxClientsManager.authorizedClient != nil {
aspiguel
4 years agoNew member | Level 2
Fleaurent,
Thank you for being a pioneer of Dropbox and SwiftUI. I've just started playing around with this kit in swiftUI and I'm wondering if you got past your last issue the client manager being nil? Thanks!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 10 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!