Implementing the Google Drive File picker in iOS

244 Views Asked by At

We are currently in the process of transitioning scopes for out app from the restricted 'auth/drive' scope to 'auth/drive.file' scope, however, it does not seem like the Google Drive Picker is prepared to render on a mobile device. The UI renders for desktop making it basically unusable in our native app. Is there a way to render it in a way that is responsive using a web view in an iOS app?

Google is asking us to migrate to a less sensitive scope and to use the picker but it seems there is no way to properly pick files and folders inside of a native mobile app. Currently we are using the drive scope and we have created a native picker ourselves. Is there a picker for mobile apps?

Any help is appreciated. Thanks!

3

There are 3 best solutions below

4
Linda Lawton - DaImTo On

drive.file scope will only allow you to access files that your application created. Anything that is on the users drive that was created by another application you will not be able to access.

My understanding from overview is that drive picker is for web applications it does not support mobile apps

it seems there may have been something eight years ago but its out of date iOS-Swift-Google-Drive-Document-Picker

1
Pingou On

I have the same issue. My plan is to create an internet page that implements the official picker, then on the mobile side have a webview that detects when any file is selected/downloaded. I will report when it has been accepted or refused by Google.

1
Enrique R. On

I was able to render the Picker in a more mobile friendly way, it is not perfect but at least it is "somehow" more usable even though you need to still double-tap to enter a folder which is quite terrible. Anyways, I did this buy adding the following css style:

  .picker {
    height: 100% !important;
    width: 100% !important;
    top: 0 !important;
  }

And then adding this meta header:

<meta name="viewport" content="initial-scale=1.0" />

With this two changes the picker displays in full screen in the WKWebView that I'm using to load the picker and the UI is in a good size.

Still wishing for a solution from Google that does not require users to double tap on folders and to allow to create subfolders from the picker!