Social live (Cocos)
FRVRSDK.instance.socialLive* opens a WebSocket to FRVR’s social server for real‑time events — friends coming online / changing status, game invites landing. Use it for in‑lobby “who’s playing?” UIs and instant game‑invite banners.
Connect
Section titled “Connect”Call once after sign‑in. The connection is maintained for the life of the session; close it on onDestroy or before leaving the scene that uses it:
Subscribe to events
Section titled “Subscribe to events”Broadcast your own status
Section titled “Broadcast your own status”Tell friends what you’re doing (in a lobby, in level 5, etc.):
Whatever object you pass is forwarded verbatim to subscribed friends’ ON_FRIEND_STATUS_UPDATED handlers.
Send a game invite
Section titled “Send a game invite”The receiver gets an ON_GAME_INVITE event with the payload you sent.
Read current friend statuses
Section titled “Read current friend statuses”Synchronous snapshot of everyone’s last broadcast status:
Use this to populate a friends list on scene load, then let the ON_FRIEND_STATUS_UPDATED event stream keep it in sync.
Lifecycle
Section titled “Lifecycle”When not to use it
Section titled “When not to use it”Social live is for real‑time signals. For one‑shot queries (a friend list at scene load, last match results), just call the plain social APIs — no socket needed.