cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Installation Process for Mac App

Installation Process for Mac App

kevaltpatel
Explorer | Level 3

I am trying to install DropoBox to my Mac App but it is showing error while I start integrating this methods in my code in the latest version of swift.

Code:

 

DropboxClientsManager.authorizeFromController(sharedWorkspace : NSWorkspace.shared, controller: self, openURL: { (url:URL) -> Void in

            NSWorkspace.shared().open(url)

        })

 

Error:

 

FirstMacAop/AppDelegate.swift:23:77: Use of unresolved identifier 'handleGetURLEvent'

 

 

 

 

Code: 

 

NSAppleEventManager.shared().setEventHandler(self,

                                                     andSelector: #selector(handleGetURLEvent),

                                                     forEventClass: AEEventClass(kInternetEventClass),

                                                     andEventID: AEEventID(kAEGetURL))

 

Error:

 

FirstMacAop/AppDelegate.swift:34:105: Cannot convert value of type 'AppDelegate' to expected argument type 'NSViewController?'

 

Can you please let me guide through the solution

 

1 Reply 1

Re: Installation Process for Mac App

Greg-DB
Dropboxer
It looks like you swapped the code and the errors, but the first error message indicates that `handleGetURLEvent` is not defined. You should add the definition from here:

https://github.com/dropbox/SwiftyDropbox#macos-4

The second error message indicates that you're passing in an AppDelegate when you should be passing in a ViewController. It sounds like you're running authorizeFromController in your AppDelegate instead of your ViewController. Move it to your ViewController code.
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?