Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS support? #702

Open
1 task done
joshsloat opened this issue Jan 31, 2020 · 8 comments
Open
1 task done

macOS support? #702

joshsloat opened this issue Jan 31, 2020 · 8 comments

Comments

@joshsloat
Copy link

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.

@sujaygarlanka
Copy link
Contributor

sujaygarlanka commented Jan 31, 2020

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.

@joshsloat
Copy link
Author

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).

@sujaygarlanka
Copy link
Contributor

sujaygarlanka commented Feb 3, 2020

@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.

@joshsloat
Copy link
Author

joshsloat commented Feb 3, 2020

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?

@sujaygarlanka
Copy link
Contributor

sujaygarlanka commented Feb 5, 2020

@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.

@joshsloat
Copy link
Author

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

@Sopan
Copy link

Sopan commented Jan 27, 2022

@sujaygarlanka Is it done yet?

@mgrytsai
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants