I'm having trouble integrating the Google Realtime API. It was working fine for a while, but then it started failing with "Drive Realtime API Error: token_refresh_required: The OAuth token must be refreshed." logged to the browser console when I call gapi.drive.realtime.load
. My auth flow is based on https://developers.google.com/identity/protocols/OAuth2UserAgent#example, and it all appears to work fine when I'm not using Realtime.
The quickstart didn't mention anything about this. I tried looking at other example Realtime code, but it mostly came up as using gapi.auth instead of gapi.auth2. I slogged through a bunch of sites talking about kicking off a timer to occasionally call .signIn
or other methods. Finally found one complete example to work from, but I completely don't follow its expiry checks and it seems to be receiving some data from Drive via the URI hash that I don't receive.
Any idea how to fix this? Or even background on what it means relative to gapi?