简体   繁体   English

需要有关iOS + Google云端硬盘的帮助

[英]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) 我需要我的ipad / iphone应用程序将文件(图像,pdf..etc)保存到中央google驱动器帐户(请注意,此应用程序将分发给多个客户端,但所有应用程序都将使用相同的google驱动器帐户)

What I have done so far: 到目前为止,我所做的是:

  • got hold of the google drive examples and sources 掌握了Google云端硬盘示例和来源
  • 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. 就我而言,我想对电子邮件和密码进行硬编码,在后台进行身份验证,然后将文件推送到Google云端硬盘。
  • 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. 好吧,这似乎是不可能的,因为总是从用户那里获取凭据和访问令牌,而新的Google Drive SDK不支持您想要的内容。 And O-Auth will also not support you as its against their policy of User Data Protection. 而且O-Auth也不会根据您的用户数据保护政策为您提供支持。

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 您可以按照与Google示例中相同的过程注释掉viewController推到前面的部分,尝试这样的调用

[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 我看了一眼Google登录页面的代码,它为文本字段和“转到”按钮提供了这些名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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