Functions - User¶
Related Oculus Platform documentation:
- https://developer.oculus.com/documentation/native/ps-presence/
- https://developer.oculus.com/documentation/native/ps-entitlement-check/
- https://developer.oculus.com/documentation/native/ps-blockingsdk/
Functions¶
user_get_logged_in_user_id¶
user_get_logged_in_user_id()
Requests the logged-in user ID.
Returns: A String
with the user ID. The String
will be "0" if there's no ID.
user_get_logged_in_user_locale¶
user_get_logged_in_user_locale()
Requests the logged-in user's locale'.
Returns: A String
with the user's locale that SHOULD conform to BCP47: https://tools.ietf.org/html/bcp47 but in reality the API replaces "-" with "_"
user_get_is_viewer_entitled¶
user_get_is_viewer_entitled()
Checks if the user that launched the app is entitled to the application/game.
Returns: A GDOculusPlatformPromise
that will be fulfilled if the user is entitled. The promise will error if the user is not entitled or if the check fails.
user_get_user¶
user_get_user(user_id : String
)
Requests information about a single user by ID.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
as a response if fulfilled. An error message will be available if rejected.
Example response:
user_get_logged_in_user¶
user_get_logged_in_user()
Requests information about the user that launched the app.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
as a response if fulfilled. An error message will be available if rejected.
Example response:
Note
Even though the Dictionary
includes a presence
key, it will not contain information other than "UNKNOWN" for the status. The current user should be 'online' for your application.
user_get_user_proof¶
user_get_user_proof()
Requests a nonce used to verify the current user. Check the official Oculus Platform documentation for more details.
Returns: A GDOculusPlatformPromise
that will be fulfilled with the nonce as a String
parameter. The function will error with a message if an error occured.
Note
A nonce is only valid once. After you use it to verify the user it becomes invalid.
user_get_user_access_token¶
user_get_user_access_token()
Requests a token of the current user suitable to make REST calls against graph.oculus.com
Returns: A GDOculusPlatformPromise
that will be fulfilled with the access token as a String
parameter. The function will error with a message if an error occured.
user_get_blocked_users¶
user_get_blocked_users()
Requests the user IDs of users blocked by the current user.
Returns: A GDOculusPlatformPromise
that will contain a Dictionary
with a data
key that can contain an Array
of user IDs as String
s, if fulfilled. The function will error with a message if an error occured.
Example response:
More info about next_page_url.
Example
user_get_logged_in_user_friends¶
user_get_logged_in_user_friends()
Requests the user IDs of the current user's friends.
Returns: A GDOculusPlatformPromise
will contain a Dictionary
with two keys: data
and next_page_url
, please see the example response from user_get_blocked_users as they return the same type of response (a list of users). The function will error with a message if an error occured.
Example
user_get_org_scoped_id¶
user_get_org_scoped_id(user_id : String
)
Requests an ID which is unique per org. Allows different apps within the same org to identify the user.
Returns: A GDOculusPlatformPromise
will contain the given user's scoped org ID as a String
. The function will error with a message if an error occured.
user_get_sdk_accounts¶
user_get_sdk_accounts()
Requests all the accounts belonging to the current user.
Returns: A GDOculusPlatformPromise
will contain an Array
of Dictionaries
with the type of account and its ID, if fulfilled. The function will error with a message if an error occured.
Example response:
Example
user_launch_block_flow¶
user_launch_block_flow(user_id : String
)
Launches a block flow to block the user associated with the given user_id
. The user/player can then decide to block or cancel the request.
Returns: A GDOculusPlatformPromise
will contain an Dictionary
reflecting the choices of the user/player. The function will error with a message if an error occured.
Example response:
Example
user_launch_unblock_flow¶
user_launch_unblock_flow(user_id : String
)
Launches an unblock flow to unblock the user associated with the given user_id
. The user/player can then decide to unblock or cancel the request.
Returns: A GDOculusPlatformPromise
will contain an Dictionary
reflecting the choices of the user/player. The function will error with a message if an error occured.
Example response:
Example
user_launch_friend_request_flow¶
user_launch_friend_request_flow(user_id : String
)
Launches a friend request flow to add the user associated with the given user_id
as a friend. The user/player can then decide to send the request or cancel it.
Returns: A GDOculusPlatformPromise
will contain an Dictionary
reflecting the choices of the user/player. The function will error with a message if an error occured.
Example response: