Skip to main content
New Participant
April 3, 2022
Solved

API: Is there an event that we can subscribe to when a friend online status changes?

  • April 3, 2022
  • 1 reply
  • 2246 views

Hi,
We are working on a Quest 2 multiplayer PvP game and on app launch we check for entitlements.

And once the user is entitled, we use the Oculus User Api `Users.GetLoggedInUserFriends()` to get the logged in player's friends and get the Oculus User data for each friend using `Users.Get(userId)`.


Is there an event that we can subscribe to when any friend's online status changes i.e., online to offline (or) offline to online, so that we don't have to keep polling/requesting the Oculus User info for each friend using `User.Get(userId)` to know their current online status.

 

Usecase: Player A has friend Player B and we get the user data of Player B at the start of the app which includes the online status.
When Player B's online status changes (becomes online from offline or becomes offline from online), an event is fired and using that we want to update the online status for Player B in the UI.

 

Is there an event like that?

 

Thank you.

This topic has been closed for replies.
Best answer by SLTej

I also posted this question on the first access forum and got a reply saying this

Unfortunately we don't have an event like that and you would have to poll the friends manually.


So polling is the only option as of now.

1 reply

SLTejAuthorAnswer
New Participant
April 25, 2022

I also posted this question on the first access forum and got a reply saying this

Unfortunately we don't have an event like that and you would have to poll the friends manually.


So polling is the only option as of now.