We are building a web application based on Google Drive API. We'd like to incorporate a facility of displaying who is viewing our "document" in real time like Google docs and spreadsheets are doing. Implementing it from scratch would be quite challenging because of the necessity to track when a user leaves the page. So we'd first like to check if anything is already available for this purpose.

We have found out Google Analytics API may be helpful, but it can only give us a number, not user names. Google Drive Realtime API looks promising and suitable for other needs of our development, however at the moment it's not clear whether it might help with displaying current viewers.

Any ideas on possible solutions would be greatly appreciated.

有帮助吗?

解决方案

This is possible in the realtime API. See https://developers.google.com/drive/realtime/handle-events#collaborator_events

There is an example of it in the Realtime Playground.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top