box-ios-sdk icon indicating copy to clipboard operation
box-ios-sdk copied to clipboard

macOS support?

Open joshsloat opened this issue 4 years ago • 8 comments

What did you do?

I attempted to integrate a macOS app with the Box SDK.

What did you expect to happen?

I realize that the name of the SDK is box-ios-sdk, but osx is listed as one of the supported platforms. As such, I expected the SDK to work with a Mac app.

Screen Shot 2020-01-31 at 11 03 40 AM

What happened instead?

The project links against the SDK without error, but then things start failing silently. I attempted using sample code to authenticate via OAuth and the call never returns. In looking at obtainAuthorizationCodeFromWebSession, I discovered that the code simply bails if not iOS. This is a silent fail without any console log if running on another platform.

    func obtainAuthorizationCodeFromWebSession(completion: @escaping Callback<String>) {
        let authorizeURL = makeAuthorizeURL(state: nonce)
        #if os(iOS)
            ... iOS goodness here...
        #endif
    }

My preference would be for the SDK to work with Mac (like Dropbox does). If Box chooses to not go that direction, the code should be updated to log a console message and/or return an error in the callback and documentation should be updated so others don't spend time going down this same path.

BoxSDK Environment

BoxSDK version: 3.1.1

Xcode version: 11.3.1

Swift version: 5

Platform(s) running BoxSDK: macOS

macOS version running Xcode: 10.15.2

Demo Project

clouduploader.zip Client secrets and IDs scrubbed from the above for both Box and Dropbox.

joshsloat avatar Jan 31 '20 16:01 joshsloat

Hello @joshsloat, You are correct in that authentication does not work for platforms other than iOS. If you create a client that takes in a developer token, the SDK should work fine for macOS. We will look into the authentication issue for the other platforms and get back to you soon. Sorry for any confusion.

sujaygarlanka avatar Jan 31 '20 19:01 sujaygarlanka

Thanks for the response @sujaygarlanka. With the developer token, though, I can only access my account, correct? It's my understanding that I could never build a Mac app for other Box users with that approach (making the SDK not particularly useful for most use cases on Mac).

joshsloat avatar Feb 03 '20 15:02 joshsloat

@joshsloat, you are correct that you will only be able to access your account. It is really only meant for development purposes. We will update our documentation to reflect that we don't support macOS. If you want support for macOS or any additional features in the future, I would submit feedback here.

sujaygarlanka avatar Feb 03 '20 19:02 sujaygarlanka

Thanks for the clarification @sujaygarlanka! The link you provided doesn't work for me. Are you suggesting I just submit a new issue for the feature request?

joshsloat avatar Feb 03 '20 20:02 joshsloat

@joshsloat Sorry, I just updated the link and it should work now. Also, we are looking into adding macOS support in the near future (SDK-450). It is on our backlog.

sujaygarlanka avatar Feb 05 '20 22:02 sujaygarlanka

Wonderful, @sujaygarlanka. I'll be looking forward to it!

joshsloat avatar Feb 06 '20 14:02 joshsloat

@sujaygarlanka Is it done yet?

Sopan avatar Jan 27 '22 23:01 Sopan

@Sopan we haven't worked on adding MacOS support yet. It is still in the backlog, but there is no concrete timeline.

mgrytsai avatar Mar 15 '22 12:03 mgrytsai