简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM