在应用中启动Google云端硬盘共享对话框。什么应该是APP_ID值? [英] Launching the Google Drive sharing dialog in an app. What should be the APP_ID value?

查看:155
本文介绍了在应用中启动Google云端硬盘共享对话框。什么应该是APP_ID值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循这篇文章,尝试添加共享对话框一个Web应用程序。



我得到了打开模式弹出窗口的按钮,但它只是在控制台中输出这个错误:

 拒绝显示'https://drive.google.com/share?id=SOME_LONG_ID&foreignService=explorer&shareService=explorer&shareProtocolVersion=2&command=init&subapp=10& popupWindowsEnabled = true& shareUiType = default& rand = 1386925457304& theme = 2& client = postMessage& appId = MY_APP_ID& embedOrigin = http%3A%2F%2Fmy_app.appspot.com'
in a frame because the set'X -Frame-Options改为SAMEORIGIN。

而模式本身只显示消息对不起,分享目前不可用。



关于文章底部的清单:




  • 用户已登录Google True

  • 用户已安装您的应用 False 我如何请他们安装?

  • 启动对话框的页面的URL必须与为该应用注册的打开URL相同。 真正



所以我有两个问题:


  1. 我如何要求他们安装我的应用程序?它应该是一个网络应用,其中有1个按钮可通过 Picker API 选择云端硬盘文件(现在正在工作),然后再播放此Drive Drive对话框的另一个按钮来设置所选文件的权限。无需安装。它是否适用于此设置?

  2. 我猜这是Cloud Console的Drive SDK部分中的ID?控制台是如此混乱,并且有很多键,ID等值,我不知道要使用哪个。 下面是我的ID以及我正在尝试使用的屏幕截图。 (1)安装意味着您必须为您提供服务。 让用户接受 drive.install 范围 - 此处的说明。这会将您的应用与Google云端硬盘中的打开方式菜单集成在一起。但在此之前,您需要告知Google云端控制台当用户点击打开时需要使用的网址 - 更多说明。在你的情况下,因为你实际上并不想让用户从Drive中打开文件,所以你不会定义任何文件类型,所以实际上实际上并不会有与Drive可见的整合。注意,共享对话框只能在一个页面上使用,该页面有你指定的URL作为打开的目标(说明中指出这一点,从经验看来,它似乎)。

    (2)客户端ID 您可以在Google云端控制台中找到它 - 请参阅上文。我的号码是12位数,所以你的号码可能也是。


    I'm following this article, trying to add a sharing dialog in a web app.

    I got the button working in opening the modal popup, but it just prints this error in the console:

    Refused to display 'https://drive.google.com/share?id=SOME_LONG_ID&foreignService=explorer&shareService=explorer&shareProtocolVersion=2&command=init&subapp=10&popupWindowsEnabled=true&shareUiType=default&rand=1386925457304&theme=2&client=postMessage&appId=MY_APP_ID&embedOrigin=http%3A%2F%2Fmy_app.appspot.com'
    in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
    

    And the modal itself just shows the message "Sorry, sharing is unavailable at this time. Please try again later."

    For the checklist at the bottom of the article:

    • The user is signed in to Google True
    • The user has installed your app False How do I ask them to install?
    • The URL of the page that launches the dialog must have the same origin as the Open URL registered for the app. True

    So I have 2 questions:

    1. How do I ask them to install my app? It's supposed to be a web app, where there's 1 button to select Drive files via the Picker API (which is now working), and then another button which will sow this Drive sharing dialog to set the permissions of the selected files. There's no need for installation. Will it work for this setup?

    2. What should be the value for the APP_ID? I'm guessing it's the ID in the "Drive SDK" section of the Cloud Console? The console is so confusing and there's so many values for keys, ids, etc. that I have no idea which to use. Here's a screenshot of what I mean by the ID and what I'm trying to use.

    解决方案

    (1) Installing means you have to get the user to accept the drive.install scope - instructions here. This will integrate your app with the "open with" menu in Google Drive. But before that can work you will need to tell the Google Cloud Console what url to go to when the user clicks "open" - more instructions. In your case, since you don't actually want to allow the user to open files from Drive you won't be defining any file types, so in reality there won't actually be any visible integration with Drive.

    Note that the share dialog will only work on the one page which has the url you specify as the target for "open" (the instructions say this and from experience it seems to be true).

    (2) Client ID You can find this in the Google Cloud Console - see above. Mine is a 12 digit number, so yours will probably be too.

    这篇关于在应用中启动Google云端硬盘共享对话框。什么应该是APP_ID值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆