We've had success with using the Save State Change event on the realtime document to determine the offline/online status of the connection. This means that you wont know you're offline until you try to make a change to the doc, but you could add a heartbeat doc change if knowing the status is critical.
See https://developers.google.com/drive/realtime/reference/gapi.drive.realtime.DocumentSaveStateChangedEvent for the event info.