Users, Friends, and Relationships
Updated: Nov 20, 2024
This is a Platform SDK feature requiring Data Use Checkup
To use this or any other Platform SDK feature, you must complete a Data Use Checkup (DUC). The DUC ensures that you comply with Developer Policies. It requires an administrator from your organization to certify that your use of user data aligns with platform guidelines. Until the app review team reviews and approves your DUC, platform features are only available for test users.Use the User object and related APIs to retrieve information about your players to customize their experience, help them find their friends, and then join them in social VR experiences with
Rooms.
Age-based feature limitations
When developing your apps, consider the following limitations related to age:
- Child users under 13 (10-12 year olds): Regardless of your app’s self-certification status, child users under 13 cannot access this Platform SDK feature. Implement error-handling for this unsupported feature to maintain a safe and pleasant experience for child users.
The following SDK methods can be called from your client app. Information about each function can be found in the Platform SDK
Reference Content.
To retrieve the unique ID, Meta Quest username, and a URL profile image for the current user, use:
The user ID returned by this method is specific only to this application. To retrieve an ID that can be used across applications in your organization, see ovr_OrgScopedID_GetID()
.
Retrieve a list of the user’s friends To retrieve an array of the current user’s friends who are also entitled to your app, use:
The list of friends is ordered by presence and returns currently active friends first.
Retrieve a list of the user’s friends and the room they are currently in
To retrieve an array of the current user’s friends who are also entitled to your app along with the room ID for users who are currently in a room, use:
The list of friends is ordered by presence and returns currently active friends first.
If there are a large number of values being returned, you may need to call ovr_User_GetNextUserAndRoomArrayPage
and paginate the data.
Retrieve a list of recently met users
To retrieve a list of users who the logged-in user recently interacted with in your app, use:
ovr_User_GetLoggedInUserRecentlyMetUsersAndRooms()
Interesting users, users who interact frequently or for a long duration, are returned first. Meta Quest tracks the number of times users meet in VR, their most recent encounter, and the amount of time they spend together. You can customize the results returned using UserOptions.
To retrieve the unique ID, Meta Quest username, and a URL profile image for a specified user, use:
This method returns a user ID specific to this application. To retrieve an ID that can be used across applications in your organization, see ovr_OrgScopedID_GetID
.
Retrieve the Org Scoped ID for a user This method returns an ID that can be used to identify this user across all applications in your organization. Please note that the OrgScopedID is not the same as the userID in an app.
If you have localized your app content into different languages, you can detect the locale of the user at runtime using the platform SDK or native Android methods. Then, use the locale to determine what language version of your app content you offer that user.
Get the Locale of the User for Link PC-VR device Apps
For example:
const char* locale = ovr_GetLoggedInUserLocale();
// Do something depending on locale value.
The return value (
locale
in this example) is a language-country code string that conforms to
BCP 47 Extension U. This means you can expect a language subtag, a dash, and a country/region subtag. For example, “en-US” represents United States English.
Use the returned locale string to decide what language your app should display and use for this user.
Get the Locale of a User for Android Apps
For apps that run on Quest devices, you get the locale of the user using the Android Locale.getDefault
method.
The returned
Locale object provides the ISO 639 alpha-2 or alpha-3 language code and the ISO 3166 alpha-2 country/region code as properties, and you can these to decide what language your app should display and use for this user.
See the
Locale object in the Android documentation for more information.