Skip to content

Functions - Group Presence

Related Oculus Platform documentation:


Functions

grouppresence_clear

grouppresence_clear()

Clears the group presence information for the current application/user.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_clear()\
.then(func(_resp : bool):
    print("Successfully cleared the group presence information!")
)\
.error(func(gp_err):
    print("Unable to clear group presence information: ", gp_err)
)

grouppresence_send_invites

grouppresence_send_invites(user_ids : Array)

Sends an invite to the specified users to join the current user session. Note that you must have ser the group presence information before to be allowed to send invites.

Returns: A GDOculusPlatformPromise that will contain a Dictionary which will contain a list of the invites that were sent, if fulfilled. The promise will error if the request couldn't be completed.

Example response:

{
    "data": [
        {
            "id": "818518747157704",
            "lobby_session_id": "some_custom_id_1877",
            "match_session_id": "some_custom_id_0544",
            "is_active": true,
            "recipient": {
                "display_name": "username",
                "id": "51054474470074144",
                "oculus_id": "user_id",
                "image_url": "https://example.org/some_url",
                "small_image_url": "https://example.org/some_other_url",
                "presence": {
                    "presence_status": "OFFLINE",
                    "presence_deeplink_message": "",
                    "presence_destination_api_name": "",
                    "presence_lobby_session_id": "",
                    "presence_match_session_id": ""
                }
            }, 
            "destination": {
                "display_name": "My Destination",
                "shareable_uri": "https://example.org/some_uri_to_share",
                "api_name": "MY_DESTINATION_0",
                "deep_link_message": "MY_DESTINATION_0_DL"
            }
        }
    ],
    "next_page_url": ""
}

More info about next_page_url.

Note

The recipient and destination can be empty Dictionaries in some cases.

Example
var user_ids : Array = ["12184515760568", "92059382048201"]

GDOculusPlatform.grouppresence_send_invites(user_ids)\
.then(func(invites_array : Dictionary):

    if not invites_array.next_page_url.is_empty():
        # Get next page
        pass

    for invite in invites_array.data:
        if invite.is_active:
            print("Invite is active!")
)\
.error(func(invites_array_err):
    print("Unable to send invites: ", invites_array_err)
)

grouppresence_set

grouppresence_set(options : Dictionary)

Sets the information of the group presence for the current application/user. A list of options that can be included is shown bellow.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Available options:

Key Type Example value
deeplink_message_override String DEEPLINK_GO_TO_LOBBY
destination_api_name String MY_AWESOME_DESTINATION
lobby_session_id String some_lobby_id_147721
match_session_id String 41808448444_match
is_joinable bool true
Example
var presence_opts : Dictionary = {
    "destination_api_name": "SNOWY_MOUNTAIN_0",
    "lobby_session_id": "some_user_lobby_0417",
    "match_session_id": "54087487487445",
    "is_joinable": true
}

GDOculusPlatform.grouppresence_set(presence_opts)\
.then(func(_resp : bool):
    print("Group presence info set!")
)\
.error(func(gp_err):
    print("Unable to set group presence information: ", gp_err)
)

grouppresence_set_deeplink_message_override(deeplink_message : String)

Sets the user's deeplink message without changing the other group presence parameters. A destination must be set before using this function.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_set_deeplink_message_override("SOME_OVERRIDE_DL")\
.then(func(_resp : bool):
    print("Group presence deeplink message set!")
)\
.error(func(gp_err):
    print("Unable to set deeplink message of group presence: ", gp_err)
)

grouppresence_set_destination

grouppresence_set_destination(destination : String)

Replaces the user's destination without chagind other group presence parameters.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_set_destination("MISTY_FOREST")\
.then(func(_resp : bool):
    print("Group presence destination set!")
)\
.error(func(gp_err):
    print("Unable to set destination of group presence: ", gp_err)
)

grouppresence_set_is_joinable

grouppresence_set_destination(is_joinable : bool)

Sets whether the current user's destination and session is joinable without changing other parameters. The destination or lobby/match session ID must be set before.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_set_is_joinable(false)\
.then(func(_resp : bool):
    print("Group presence joinable state set!")
)\
.error(func(gp_err):
    print("Unable to set joinable state of group presence: ", gp_err)
)

grouppresence_set_lobby_session

grouppresence_set_lobby_session(id : String)

Replaces the user's lobby session ID without chagind other group presence parameters.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_set_lobby_session("354141101")\
.then(func(_resp : bool):
    print("Group presence lobby session set!")
)\
.error(func(gp_err):
    print("Unable to set lobby session of group presence: ", gp_err)
)

grouppresence_set_match_session

grouppresence_set_match_session(id : String)

Replaces the user's match session ID without chagind other group presence parameters.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_set_match_session("my_match_651475")\
.then(func(_resp : bool):
    print("Group presence match session set!")
)\
.error(func(gp_err):
    print("Unable to set match session of group presence: ", gp_err)
)

grouppresence_get_invitable_users

grouppresence_get_invitable_users(options : Dictionary)

Requests a list of invitable users that can be invited to the current session. The list includes the user's bidirectional followers and other recently met users. The options argument is optional, and a list of allowed keys and examples is shown bellow.

Returns: A GDOculusPlatformPromise that will contain a Dictionary with two keys: data and next_page_url. The data key will contain a list of users, if fulfilled. The promise will error if the request couldn't be completed.

Available options for options:

Key Type Example
suggested_users Array of Strings ["8110887962260", "2154895289701"]

Each element of the suggested_users Array should be a user ID as a String. Adding users to suggested_users will add them to the invitable users list.

Note

Take a look at the example response and the note from the user_get_blocked_users function to know more details about the possible response from this function.

Example
1
2
3
4
5
6
7
8
9
GDOculusPlatform.grouppresence_get_invitable_users()\
.then(func(users : Dictionary):

    for user in users.data:
        print("User: ", user.display_name)
)\
.error(func(gp_invitable_users_err):
    print("Unable to get a list of invitable users: ", gp_invitable_users_err)
)

grouppresence_get_sent_invites

grouppresence_get_sent_invites()

Requests a list of invites sent by the current user.

Returns: A GDOculusPlatformPromise that will contain a Dictionary which will contain a list of the invites that have been sent by the user, if fulfilled. The promise will error if the request couldn't be completed.

Note

Take a look at the example response and the note from the grouppresence_send_invites function to know more details about the possible response from this function.

Example
GDOculusPlatform.grouppresence_get_sent_invites()\
.then(func(invites_array : Dictionary):
    if not invites_array.next_page_url.is_empty():
        # Get next page
         pass

    for invite in invites_array.data:
        if not invite.is_active:
            print("Invite is inactive!")
)\
.error(func(invites_array_err):
    print("Unable to get sent invites: ", invites_array_err)
)

grouppresence_launch_invite_panel

grouppresence_launch_invite_panel(options : Dictionary)

Launches the invite panel to invite other users to join the current session. The options argument is optional, and a list of allowed keys and examples is shown bellow.

Returns: A GDOculusPlatformPromise that will contain a bool that indicates if the user did invite other users or not, if fulfilled. The promise will error if the request couldn't be completed.

Available options for options:

Key Type Example
suggested_users Array of Strings ["8110887962260", "2154895289701"]

Each element of the suggested_users Array should be a user ID as a String. Adding users to suggested_users will add them to the invitable users list.

Example
var options : Dictionary = {
    "suggested_users": ["5015441880527"]
}

GDOculusPlatform.grouppresence_launch_invite_panel(options)\
.then(func(did_send_invite : bool):
    if did_send_invite:
        print("Great! now wait for them to respond to your request.")
)\
.error(func(launch_invite_p_err):
    print("Unable to launch invite panel: ", launch_invite_p_err)
)

grouppresence_launch_multiplayer_error_dialog

grouppresence_launch_multiplayer_error_dialog(error_key : MultiplayerErrorErrorKey)

Shows an error dialog with a predefined message.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Enums:

MultiplayerErrorErrorKey:

Name Value Description
MULTIPLAYER_ERR_KEY_DEST_UNAVAILABLE 1 Destination unavailable
MULTIPLAYER_ERR_KEY_DLC_REQUIRED 2 A DLC is required
MULTIPLAYER_ERR_KEY_GENERAL 3 Generic error message
MULTIPLAYER_ERR_KEY_GROUP_FULL 4 The lobby/match is full
MULTIPLAYER_ERR_KEY_INVITER_NOT_JOINABLE 5 The inviter cannot be joined
MULTIPLAYER_ERR_KEY_LVL_NOT_HIGH_ENOUGH 6 User is not of high enough level
MULTIPLAYER_ERR_KEY_LVL_NOT_UNLOCKED 7 The level has not been unlocked yet
MULTIPLAYER_ERR_KEY_NETWORK_TIMEOUT 8 Network timed out
MULTIPLAYER_ERR_KEY_NO_LONGER_AVAILABLE 9 The lobby/match/invite is not longer valid or available
MULTIPLAYER_ERR_KEY_UPDATE_REQUIRED 10 An update is required
MULTIPLAYER_ERR_KEY_TUTORIAL_REQUIRED 11 Completing the tutorial is required
Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_launch_multiplayer_error_dialog(GDOculusPlatform.MULTIPLAYER_ERR_KEY_GROUP_FULL)\
.then(func(_resp_ : bool):
    print("User was informed that the group is already full.")
)\
.error(func(mp_error_err):
    print("Unable to launch multiplayer error dialog: ", mp_error_err)
)

grouppresence_launch_rejoin_dialog

grouppresence_launch_rejoin_dialog(lobby_session_id : String, match_session_id : String, destination_api_name : String)

Launches a rejoin dialog to allow the user to rejoin a previous session from a lobby/match ID. lobby_session_id and/or match_session_id must be set, but if you only use one and not the other, you can pass an empty String as the parameter.

Returns: A GDOculusPlatformPromise that will contain a bool which will indicate if the user decided to rejoin or not, if fulfilled. The promise will error if the request couldn't be completed.

Example
1
2
3
4
5
6
7
8
GDOculusPlatform.grouppresence_launch_rejoin_dialog("8458441_my_lobby", "", "DEST_QUIET_LAKE")\
.then(func(did_rejoin : bool):
    if did_rejoin:
        print("User decided to rejoin, send them to the correct location!")
)\
.error(func(launch_rejoin_err):
    print("Unable to launch rejoin panel: ", launch_rejoin_err)
)

grouppresence_launch_roster_panel

grouppresence_launch_roster_panel(options : Dictionary)

Launches the roster panel which displays the current user in the roster and also users in the same session. The options argument is optional, and a list of allowed keys and examples is shown bellow.

Returns: A GDOculusPlatformPromise that will contain a bool which will always be true, if fulfilled. The promise will error if the request couldn't be completed.

Available options for options:

Key Type Example
suggested_users Array of Strings ["8110887962260", "2154895289701"]

Each element of the suggested_users Array should be a user ID as a String. Adding users to suggested_users will add them to the invitable users list (the user can invite other users from the roster panel as well).

Example
1
2
3
4
5
6
7
GDOculusPlatform.grouppresence_launch_roster_panel()\
.then(func(_resp : bool):
    print("Successfully opened roster panel.")
)\
.error(func(launch_roster_err):
    print("Unable to launch roster panel: ", launch_roster_err)
)