API reference
API reference
Select your platform
No SDKs available
No versions available

GroupPresence Class

The Group Presence API currently supports immersive apps and is designed to update the platform with a user's current com.meta.horizon.platform.ovr.models.Destination#getApiName() and status, including whether they are com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setIsJoinable(boolean), their com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String), and com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String). This allows a user's location to be displayed both in VR and outside of it on social platforms, and highlights popular destinations in your app. "Joinable" indicates that a user is in an area of your app that supports other users interacting with them.
Note These APIs are currently supported only for immersive mode. For non-immersive apps, such as regular Android-based panel apps or 2D experiences, this functionality is not yet supported.

Static Member Functions

Clears the current group presence settings for your app. Use this when a user's group presence setting in your app needs to be changed when moving to new destinations in your app.
Returns a list of users that can be invited to your current lobby. These are pulled from your bidirectional followers and recently met lists.
Parameters
options
- It contains two methods. 1. com.meta.horizon.platform.ovr.options.InviteOptions#addSuggestedUser(long) - Takes the userID as a parameter and adds it to the inevitable users list. 2. com.meta.horizon.platform.ovr.options.InviteOptions#clearSuggestedUsers() - Clears the inevitable users list.
Get the application invites which have been sent by the user.
Launches the system invite dialog with a roster of eligible users for the current user to invite to the app. It is recommended that you surface a button in your UI that triggers this dialog when a user is joinable.
Parameters
options
- It contains two methods. 1. com.meta.horizon.platform.ovr.options.InviteOptions#addSuggestedUser(long) - Takes the userID as a parameter and adds it to the inevitable users list. 2. com.meta.horizon.platform.ovr.options.InviteOptions#clearSuggestedUsers() - Clears the inevitable users list.
Launch an error dialog window with predefined messages for commonly occurring multiplayer errors. Check the Invokable Error Dialogs documentation for more information about these error messages and their values.
Parameters
options
- It contains a com.meta.horizon.platform.ovr.options.MultiplayerErrorOptions#setErrorKey(MultiplayerErrorErrorKey) associated with the predefined error message to be shown to users.
Launch the dialog allowing users to rejoin a previous lobby or match. Either the user's com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String), their com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String), or both must be populated as valid rejoinable destinations. Check the Rejoin documentation for use cases and information on this feature.
Parameters
lobbySessionId
- The unique identifier of the lobby session to rejoin.
matchSessionId
- The unique identifier of the match session to rejoin.
destinationApiName
- The unique name of the in-app destination to rejoin.
Launch the panel displaying the current users in the roster. We do not recommend using this API because the list current users is surfaced in the Destination UI when the Meta Quest button is pressed.
Parameters
options
- It contains 2 methods. 1. com.meta.horizon.platform.ovr.options.RosterOptions#addSuggestedUser(long) - it takes userID as a parameter and adds it to the inevitable users list. 2. com.meta.horizon.platform.ovr.options.RosterOptions#clearSuggestedUsers() - it clears the inevitable users list.
Sends invites to the current application to the list of userIDs passed in. You can fetch a list of users to pass in via the com.meta.horizon.platform.ovr.requests.GroupPresence#getInvitableUsers(InviteOptions options). This API works as an alternative to com.meta.horizon.platform.ovr.requests.GroupPresence#launchInvitePanel(InviteOptions options) which delegates the invite flow to the system invite module. com.meta.horizon.platform.ovr.requests.GroupPresence#launchInvitePanel(InviteOptions options) is the recommended approach.
Parameters
userIDs
- userIDs is a list of users' ids to send invites to.
Sets group presence information for your current app. It is recommended that you use this parameter and its methods to set group presence information for your app. An example of using this parameter can be found on the Group Presence overview page where the methods to set com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String), com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String), and com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) are used.
Parameters
groupPresenceOptions
- The groupPresenceOptions parameter contains five methods. 1. com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDeeplinkMessageOverride(String) - Use com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) or com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String) to specify the session. Use the com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDeeplinkMessageOverride(String) for any additional data in whatever format you wish to aid in bringing users together. If not specified, the deeplink_message for the user will default to the one on the destination. 2.com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String) - This the unique API Name that refers to an in-app destination. 3.com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setIsJoinable(boolean) - Set whether or not the person is shown as joinable or not to others. A user that is joinable can invite others to join them. Set this to false if other users would not be able to join this user. For example, the current session is full, or only the host can invite others and the current user is not the host. 4.com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) - This is a session that represents a closer group/squad/party of users. It is expected that all users with the same lobby session id can see or hear each other. Users with the same lobby session id in their group presence will show up in the roster and will show up as "Recently Played With" for future invites if they aren't already Oculus friends. This must be set in addition to com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setIsJoinable(boolean) being true for a user to use invites. 5.com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String) - This is a session that represents all the users that are playing a specific instance of a map, game mode, round, etc. This can include users from multiple different lobbies that joined together and the users may or may not remain together after the match is over. Users with the same match session id in their group presence will not show up in the Roster, but will show up as "Recently Played with" for future invites.
Sets the user's com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDeeplinkMessageOverride(String) while keeping the other group presence parameters the same. If the destination of the user is not set, the deeplink message cannot be set as there's no deeplink message to override. This method does not power travel from the Meta Quest platform to your app. You must set a user's com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String), com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setIsJoinable(boolean) status, and com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) to enable travel to your app. Check Group Presence overview for more information about these values. Note: Instead of using this standalone API, we recommend setting all GroupPresence parameters in one call to com.meta.horizon.platform.ovr.requests.GroupPresence#set(GroupPresenceOptions groupPresenceOptions).
Parameters
deeplinkMessage
- deeplink_message is the new com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDeeplinkMessageOverride(String) to set for the user, overriding the current deeplink message.
Replaces the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String) with the provided one. Use this to set a user's current destination while keeping all the other Group Presence parameters the same. Setting a user's destination is required to enable travel from the Meta Quest Platform to your app. NOTE instead of using the standalone API, we recommend setting all GroupPresence parameters in one call to com.meta.horizon.platform.ovr.requests.GroupPresence#set(GroupPresenceOptions groupPresenceOptions). This helps ensure that all relevant presence information is singularly updated and helps reduce presence errors.
Parameters
apiName
- api_name is the unique name of the in-app desination to set, replacing the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String).
Sets a user's current presence as joinable. Use this method to update a user's joinability as it changes. For example, when the game starts, the lobby becomes full, the user moves to a private, non joinable instance while keeping all other GroupPresence parameters (i.e com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setDestinationApiName(String), com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String), com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String)) the same. Setting a user's destination is required to enable travel from the Meta Quest Platform to your app. Note: Instead of using this individual API, we recommend setting all GroupPresence information with the com.meta.horizon.platform.ovr.requests.GroupPresence#set(GroupPresenceOptions groupPresenceOptions) method and its associated parameters to simply managing all presence information. This helps ensure that all relevant presence information is singularly updated and helps reduce presence errors.
Parameters
isJoinable
- If com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setIsJoinable(boolean) is true, the user can invite others to join them. If false, other users cannot join this user, for example, if the current session is full or only the host can invite others and the current user is not the host.
Replaces the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) for the provided string. Use this to set a user's current lobby session id while keeping all other GroupPresence parameters the same. Setting a user's lobby session id is required to enable travel from the Meta Quest Platform to your app. Check Group presence overview for more information. NOTE instead of using the standalone API, we recommend setting all GroupPresence parameters in one call to com.meta.horizon.platform.ovr.requests.GroupPresence#set(GroupPresenceOptions groupPresenceOptions). This helps ensure that all relevant presence information is singularly updated and helps reduce presence errors.
Parameters
id
- id is the unique identifier of the lobby session to set, replacing the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String).
Replaces the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String) for the provided one. Use this to update the user's current match session id while keeping all other GroupPresence parameters the same. com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String) works in conjuction with com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setLobbySessionId(String) to determine if users are playing together. If a user's match and lobby session ids are the same, they should be in the same multiplayer instance together. Users with the same lobby session id but different match session ids may be in the same lobby for things like voice chat while in different instances in your app. WARNING match session id is often treated the same as lobby session id, but this is in fact a distinct parameter and is not used for travel from the Meta Quest Platform. NOTE instead of using the standalone API, we recommend setting all GroupPresence parameters in one call to com.meta.horizon.platform.ovr.requests.GroupPresence#set(GroupPresenceOptions groupPresenceOptions).
Parameters
id
- id is the unique identifier of the match session to set, replacing the user's current com.meta.horizon.platform.ovr.options.GroupPresenceOptions#setMatchSessionId(String).
Sent when the user is finished using the invite panel to send out invitations. Contains a list of invitees. Parameter: Callback is a function that will be called when the invitation sent status changes. com.meta.horizon.platform.ovr.models.LaunchInvitePanelFlowResult has 1 member: UserList com.meta.horizon.platform.ovr.models.LaunchInvitePanelFlowResult#getInvitedUsers() - A list of users that were sent an invitation to the session.
Sent when a user has chosen to join the destination/lobby/match. Read all the fields to figure out where the user wants to go and take the appropriate actions to bring them there. If the user is unable to go there, provide adequate messaging to the user on why they cannot go there. These notifications should be responded to immediately. Parameter: Callback is a function that will be called when a user has chosen to join the destination/lobby/match. com.meta.horizon.platform.ovr.models.GroupPresenceJoinIntent has 4 members: string com.meta.horizon.platform.ovr.models.GroupPresenceJoinIntent#getDeeplinkMessage() - An opaque string provided by the developer to help them deeplink to content. string com.meta.horizon.platform.ovr.models.GroupPresenceJoinIntent#getDestinationApiName() - The destination the current user wants to go to. string com.meta.horizon.platform.ovr.models.GroupPresenceJoinIntent#getLobbySessionId() - The lobby session the current user wants to go to. string com.meta.horizon.platform.ovr.models.GroupPresenceJoinIntent#getMatchSessionId() - The match session the current user wants to go to.
Sent when the user has chosen to leave the destination/lobby/match from the Oculus menu. Read the specific fields to check the user is currently from the destination/lobby/match and take the appropriate actions to remove them. Update the user's presence clearing the appropriate fields to indicate the user has left. Parameter: Callback is a function that will be called when the user has chosen to leave the destination/lobby/match. com.meta.horizon.platform.ovr.models.GroupPresenceLeaveIntent has 3 members: string com.meta.horizon.platform.ovr.models.GroupPresenceLeaveIntent#getDestinationApiName() - The destination the current user wants to leave. string com.meta.horizon.platform.ovr.models.GroupPresenceLeaveIntent#getLobbySessionId() - The lobby session the current user wants to leave. string com.meta.horizon.platform.ovr.models.GroupPresenceLeaveIntent#getMatchSessionId() - The match session the current user wants to leave.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon