预览并打开 [英] Preview and open-with

查看:292
本文介绍了预览并打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在我的Google驱动器上使用Realtime playground创建的文件支持 Open With 功能。尽管预览不可用,但我可以点击它并重新打开游乐场应用程序。我如何对我的应用程序做同样的事情。我创建了一个 Google应用程序文件与我创建的应用程序。但是,点击它会导致


抱歉,我们无法为您
试图访问的所有文件授权此应用程序打开。请重试。



是因为我基本上有一个不好的业力还是有客观原因,我错过了?






第一个答案表明我必须做 Google Drive API Drive UI集成文档特别说明 open- 打开URL片段一>。经过努力,我添加了通过验证在集成设置中打开URL ,但这不起作用。我仍然收到相同的无法授权此应用程序错误

解决方案

确保您已启用 Drive SDK服务



错误抱歉,我们无法为您尝试打开的所有文件授权此应用。请再试一次。表示您需要授权用户。 Google API使用OAuth 2.0协议进行身份验证和授权。 Google支持常见的OAuth 2.0场景,例如Web服务器,已安装的应用程序和客户端应用程序。

使用 从您的OAuth 2.0凭证中获取OAuth 2.0凭证Google API Console。

  • 从Google授权服务器获取访问令牌。

  • 将访问令牌发送到API。

  • 如有必要,刷新访问令牌。 :将刷新令牌保存在安全的长期存储中,只要它们保持有效,就继续使用它们。限制适用于每个客户端 - 用户组合以及每个用户在所有客户端上发布的刷新令牌的数量,这些限制是不同的。如果您的应用程序请求足够的刷新标记以超过其中一个限制,旧的刷新标记将停止工作。


    I see that the file created with Realtime playground at my Google drive supports Open With functionality. Despite preview is not available, I can click it and playground app reopens. How do I do the same with my app. I have created a demo one, to add/remove list items and it creates the files in my google drive, similarly to the google realtime playground functionality. The open with is also available.

    Google app files with my app it created. But, clicking it, results in

    Sorry, we were unable to authorize this app for all of the files you attempted to open. Please try again.

    Is it because I basically have a bad karma or there is objective reason that I miss?


    The first answer suggests that I have to do Google Drive API Drive UI integration. The doc says particularly, that open-with is provided by Open URL piece. With a great effort, I have added the verified Open URL in the integration settings, but this has no effect. I am still getting the same Unable to authorize this app error.

    解决方案

    Make sure that you have enabled the Drive SDK service.

    The error Sorry, we were unable to authorize this app for all of the files you attempted to open. Please try again. means that you need to authorize the user. Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports common OAuth 2.0 scenarios such as those for web server, installed, and client-side applications.

    All applications follow a basic pattern when accessing a Google API using OAuth 2.0. At a high level, you follow four steps:

    • Obtain OAuth 2.0 credentials from the Google API Console.
    • Obtain an access token from the Google Authorization Server.
    • Send the access token to an API.
    • Refresh the access token, if necessary.

    Note: Save refresh tokens in secure long-term storage and continue to use them as long as they remain valid. Limits apply to the number of refresh tokens that are issued per client-user combination, and per user across all clients, and these limits are different. If your application requests enough refresh tokens to go over one of the limits, older refresh tokens stop working.

    这篇关于预览并打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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