Download files from google drive - ios

In my app i have to show a list of docs from users google drive account. User will be able to download it.
I have implemented Google Drive ios sdk, successfully implemented login and also fetching the files.
But there is no download url to download the files.
Scope is kGTLAuthScopeDrive
In some stackoverflow posts i saw people posted downloadUrl property of GTLDriveFile. But in my SDK there is no such property.
Maybe they changed something in the latest SDK.
Need help here . I am really stuck at the moment.

Related

Codenameone Connect to Google Drive

This may be a dumb questions, but I haven't found an answer after lots of searching. I need to do two things, I need to allow my app to login to google, then save a file the users google drive.
I've found some steps on how to connect to google drive, but either its outdated or I don't have the correct libraries because it fails to compile: https://www.codenameone.com/google-login.html
Any help would be greatly appreciated.
For the login part there are good instructions in this blog post
Another sample of code to login to Google in this demo
You'll need to set the scope of the OAuth2 login to the appropriate Google Drive Scope
For saving files to drive, you should use ConnectionRequest to create the HTTP requests directly to their REST API.
Check the Integrating Google Sign-In into your web app. There's even an video guide explaining the concept.
There's a quick Save to Drive which enables your web site to allow users to save files to their Drive account from an arbitrary URL via their browser. If that's not sufficient enough, you can always check the Uploading Files where you can upload file data by creating or updating a File resource.

disallowed_useragent with Google Drive SDK

I am trying to implement Google Drive SDK in my project but nothing seems to go well, i wanted to upload images and create folder on Google Drive but i am stuck with the error ,which i don't know how to get through, as i found nothing related to the following error.
I have strongly followed this link for code
Google has updated its security restrictions for OAuth flow. They are not going to allow native web-views to initiate OAuth flows. You will need to use the OS browsers to do so.
Modernizing OAuth interactions in Native Apps for Better Usability and Security
You may have to wait for google to update the sample code or figure out how to do it yourself sorry i am not an IOS developer so cant be of any help.
The issue is already logged on the issue forum for Google drive 4919

Dropbox chooser with Oauth

I am working on integrating dropbox with iOS application. I want to implement below functionality.
User can share his existing dropbox file with app.
If user modifies any of the files, i should able to fetch the updated file and notify app server.
Also these files are not app related ones. User can share any docs in his dropbox account with app
After going through API, i found that i can use dropbox chooser UI to share files. chooser is generating temporary URL which i can share with my server to extract the file from dropbox.
But to get the modified files, i have to integrate with OAuth permission to run delta query on dropbox account. Here i am struck with two parallel functionalities chooser and OAuth which seems not related to each other. Even while asking OAuth permission also, dropbox taking to web url to grant permission instead of showing already logged in user on iOS.
How do i verify both chooser account and OAuth granted account are same? How will i show dropbox chooser(of OAuth connected) when user wants to add any file to app?
Correct me if i am wrong in understanding dropbox API. Also let me know if i have to provide more details.

Is that possible to download google derive files without integration with ios

Is that possible to download files from google drive without integrate it's sdk (class files) or authentication. Consider following scenario:
I Used UIWebView in mysample application.
I am logged in to Google Drive through UIWebView (Like logged in to google drive same as browser logged in).
Now i want to download google drive documents in to mysample application document folder.
Problem:
When i am trying to download file from google drive it will now downloaded (I am using nsurl connection or ASIHttpRequest for download file).
I Integrate GoogleSDK (Class Library) in another sample application it will work fine and files are downloaded using file.downloadURL.
Now, My simple question is can we download files from google drive by UIWebView logged in or not? Is there any way?
We don't support integrating with the iOS web view, and suggest you use the SDK.

Need Help Concerning iOS + Google Drive

What I want to do:
I need my ipad/iphone app to save files (image, pdf..etc) to a central google drive account
(note this app will be distributed to several clients, but all app will use same google drive account)
What I have done so far:
got hold of the google drive examples and sources
made a new test project, included the libraries required, build works fine
Problem:
All examples seem to use controlers/views to authenticate and use credentials from keychain.
In my case, I want to hardcode the email and password, do the authentication in the background and then push the files to Google Drive.
I have not found some good pointers or explanation as to how to achieve this and the sample code provided by google seems to be a whole mess..
I'm having a hard time to figure this out.
Well this seems to be quite impossible as the credentials and access token are obtained from the user always and the new Google Drive SDK does not support to what you want. And O-Auth will also not support you as its against their policy of User Data Protection.
You could try a call like this, following the same process as in the Google Example commenting out the part where the viewController is pushed to the front
[webView stringByEvaluatingJavaScriptFromString:#"document.getElementById('Email').value='ur.email#gmail.com';"];
[webView stringByEvaluatingJavaScriptFromString:#"document.getElementById('Passwd').value='urPass';"];
[webView stringByEvaluatingJavaScriptFromString:#"document.getElementById('signIn).click();"];
I glanced at the code for the google signin page and it gave these names for the text fields and for the "go" button

Resources