Questions tagged [google-drive-realtime-api]

As of November 2017 Google deprecated the Realtime API, and it is unavailable for new projects. It will stop working on December 11th 2018. It provided collaboration as a service for files in Google Drive via the use of operational transforms. The API was a JavaScript library hosted by Google that provided collaborative objects, events, and methods for creating collaborative applications.

The Realtime API lets you, the developer, design a shared data model that looks just like a local, in-memory data model. You write code to manipulate maps, lists, and your own custom JavaScript data model objects. When your code makes a change to the data model on behalf of some user, the data model automatically changes for all the users on the document.

These collaborative data model objects work just like local in-memory data model objects, with one exception. Unlike a local JavaScript data model, a collaborative Realtime API data model may change as a result of edits that were made by someone other than the current user. As a result, applications need to attach listeners to a collaborative document so that the UI may be updated to reflect remote changes.

The Realtime API is based on the same collaboration technology used by Google Docs. Whenever a collaborative data model is modified, the change is applied immediately to the local, in-memory copy of the document. The API then silently sends a representation of the change to the server (called a "mutation") so that the change can be recorded in the document and communicated to other collaborators. The mutations have been carefully designed so that conflicts between collaborators can always be automatically resolved, so users will never have to see a message about edit conflicts.

Realtime data models are "eventually consistent." That means that if all collaborators stop editing, eventually everyone will see the same data model. However, we make no guarantees about when all the collaborators will see the changes or what order the changes will be delivered in.

See https://developers.google.com/drive/realtime

520 questions
2
votes
0 answers

How to programmatically find email associated to a google email (Google Drive)

Can anyone offer some advice as to how this challenge can be overcome?? Scenario A Google account can have multiple email address associated with. e.g abc@yahoo.com can be an email address associated with a Google account, however if a user has…
2
votes
1 answer

Was the Drive Realtime API changed today?

I have a Realtime API application in which the prototype of gapi.drive.realtime.CollaborativeString is modified to provide extra methods. Today (October 30, 2014) at about 10 AM EDT, the app suddenly stopped working. It turns out that accessing…
2
votes
0 answers

Keeping track of doc's words count in google apps script

I'm writing a Google Docs Add-on and would like to keep track of word count in the extension whenever user adds/deletes new word. My initial approach is: in Code.gs: function getWordCount() { var st =…
2
votes
1 answer

Can we mark a change in Google Drive's Realtime API as un-undoable?

We need to migrate some data in our users documents, which we are accessing through Google Drive's Realtime API. We don't want them to undo the change, since that would take the document back to a format that our application no longer understands. I…
Iain
  • 4,203
  • 23
  • 21
2
votes
2 answers

app.js JavaScript API on Google Drive

I'm investigating Google Drive's real-time API. In the QuickStart Tutorial the JavaScript library loaded is https://apis.google.com/js/api.js. The Drive documentation describes this library as the Google JavaScript API loader. This library seems to…
2
votes
1 answer

Google Drive Realtime API SDK for Node.js or Objective-C?

What's the status of the Drive Realtime API library for Node.js or Objective-C? Am I correct that the only supported use case is client side in a browser (judging by the docs)? I spent two days trying to get it working with a Mac app, no success…
2
votes
0 answers

Google Realtime API with Google Docs

I would like to build an application on a webpage, that does as google docs: I want to build an app that allow people to work on a document in collaboration I start with this: https://developers.google.com/drive/realtime/realtime-quickstart But the…
2
votes
0 answers

Google Relatime API stops responding after computer wakes up from sleep mode

Easy to reproduce: Go to https://realtime-cube.appspot.com start a new game Open a second tab with the same game Make sure that both tabs are realtime connected upon change. Now, put your computer (in my case Mac OSX) in a sleep mode for 4 seconds…
ganoro
  • 508
  • 5
  • 11
2
votes
0 answers

creating custom objects using google realtime api

I try to connect my kineticjs script with google realtime but i don't understand how to create custom collaborative objects in google realtime to make my app synchronous. Does anyone know how to create a custom object with google realtime api.…
2
votes
1 answer

Drive Realtime API model size limit exceeded despite empty root

I have a drive file that seems to have a corrupted or leaky realtime document. When I call realtimeDocument.getModel().getRoot().toString(), the output is {slides: []}, but when I try to insert a new slide (a custom object with 10 or 15 small string…
Riley Lark
  • 20,660
  • 15
  • 80
  • 128
2
votes
3 answers

Is it possible to use client-side generated blob url to save to Google Drive

I'm generating a CSV client-side and putting it into a Blob and then creating an object URL. What I'm attempting to accomplish is generate this blob URL and then save the file to Google Drive. I'm using the Save to Drive button in this example but…
jordan
  • 121
  • 1
  • 8
2
votes
0 answers

Cannot upload file to Google Drive using API for service account

To upload files to Google Drive using service account, I have written the following code which is from this link: https://developers.google.com/drive/web/service-accounts My code: require_once "google-api-php-client/src/Google_Client.php"; …
2
votes
1 answer

Onfileloaded event not called when file is opened from Drive

I am trying to open a file in my Google Drive which was created by my Google Realtime application. Although the URL opens correctly, the onfileloaded event is not fired following the afterAuth event. Should I expect and handle a different event in…
2
votes
1 answer

How can I store images in drive files?

My app will store many photos arranged within one drive file, like a google doc with many images inline. The api to update the file, however, requires a full body upload for each save, so when my user inserts his tenth image, the previous nine…
Riley Lark
  • 20,660
  • 15
  • 80
  • 128
2
votes
1 answer

Copy Realtime documents of drive files when user chooses to "Make a Copy"

My app uses the realtime api to store most of the data in a document. The Drive UI gives users the option of making a copy of the files my app created, but the copies do not include copies of the realtime documents associated with the files!…
Riley Lark
  • 20,660
  • 15
  • 80
  • 128