共享实时文档

Sharing the Realtime Documents

我创建了一个 playground 应用程序。我看到它在我的 google 驱动器中创建了快捷方式文件。我尝试使用隐身模式分享它(因为我希望任何人都可以使用该文档,但不知道如何创建另一个 google 帐户,所以我退出进入隐身模式)。共享的 link 看起来像 https://drive.google.com/open?id=0B00--A0eRH1JLTdsX2t0LWw5RE0。但是,隐身无法查看它。它说 "No preview avaialable" 在它的 google 驱动器 window 中并提供登录

我看到的关键问题是playground应用有如下结构,来自官方demo

function onAuthorized() {
    function onFileLoaded(doc) {display(doc)}
    gapi.drive.realtime.load(your_doc_id, onFileLoaded)
}

// App entry point -- start by authorization
gapi.auth.authorize({
    client_id: rtClientId, scope: ['install', 'file'],
    //user_id: userId,
    immediate: !popup }, onAuthorized
);

这似乎首先要求在显示任何文档之前进行身份验证。对于我希望我的应用程序可用的未签名模式,授权是有问题的。我想共享一个文件并让一般人 public 可以查看它,而无需登录。这引发了一个问题,即隐身用户是否能够查看或编辑我的文档。如果需要,我还关心如何将文档复制到他们的帐户:一件事是当您使用我的应用程序在驱动器上创建文件时,您可以列出文件并使用 drive.copy api 进行复制当你想复制一个在你的 google 驱动器上不可用的文件并且你唯一拥有的就是它的 ID 时,你想要的是一件事和另一件事。

顺便说一句,你能告诉我从另一个帐户使用哪个帐户进行非隐身测试吗?如果我在一个帐户中创建文档,我想从另一个帐户中查看它是如何 looks/accessible 的。

“顺便说一句,你能告诉我从另一个帐户使用哪个帐户进行非隐身测试吗?如果我在一个帐户中创建文档,我想看看它是如何从 looks/accessible另一个。"

对一个帐户使用 Chrome。使用 Firefox 和其他浏览器获取后续帐户。

补充说明:

就是为了让你有一个清晰的认识what Incognito is all about。它能做什么,不能做什么,这样你就不会混淆了。

How incognito mode works

What you view

Incognito is a mode that opens a new window where you can browse the Internet in private without Chrome saving the sites you visit. You can switch between an incognito window and any regular Chrome browsing windows you have open. You'll only be in incognito mode when you're using the incognito window.

Be careful. Incognito mode only prevents Chrome from saving your site visit activity. It won't stop other sources from seeing your browsing activity, including:

Your internet service provider Your employer (if you're using a work computer) The websites you visit themselves What you've downloaded

Chrome won’t save a record of the files you download in incognito mode. However, the downloaded files will be saved to your computer’s Downloads folder, where you and any other users of your computer can see and open them, even after you close your incognito tabs.

Realtime API 默认不提供匿名访问。参见 https://developers.google.com/google-apps/realtime/faq#does_the_realtime_api_support_anonymous_access