Search code examples
iosdropboxdropbox-apitvos

Authentication to dropbox on tvOS


I am using dropbox sdk in my ios mobile app ,it uses dropbox authentication fetches users files from dropbox in my application .. its working perfectly on my ios application and its uploaded on apple store . i want to make it available for tvos apple stores also.

but i am unable to authenticate to dropbox in tvos , as it opens authentication dialog to login and there is no way for the user to fill it, the UI does not meet the tvOS requirements. So I want to open a tvOS dialog for username/password. But Is there a way then to take this data to authenticate manually, i.e. using code that will input the dropbox username and password?

after searching i have found many references but their are no proper documentation for tvos platform. i have looked up following links but unable to authenticate in tvos

authentication to dropbox via dropboxDevelopers

dropbox community forums

dropbox api sdks

enter image description here enter image description here

Any help/suggestion to this would be very helpful to me...


Solution

  • As suggested by Apple at the Apple TV Tech Talks 2016 (Best Practices for Designing tvOS Apps, min. 12), the main pattern that should be used when you need to collect data from Apple TV users is to redirect them to the web or to a companion app.

    As it happens in the screenshot you posted, the tvOS app should ask the user to visit a website in order to insert a code and log into using the Dropbox credentials.

    You can also ask your user to download/open a companion app on iOS. This is suggested when you have multiple fields to fill.

    In both cases you can poll the server every 5-10 seconds to check if the user logged into successfully or not. As suggested in the first link you've posted, you can try to take a look to Digits by Twitter now supporting tvOS. Also note that UIWebView and SFSafariViewController aren't available on tvOS.