Users, friends, and relationships manages information about each user's unique persona, their relationship with their friends, and their recent encounters in VR.
Use the user and friends 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. The relationships APIs help users find new friends from their recent VR encounters.
The following SDK methods can be called from your client app. Detail about each function can be found in the Platform SDK Reference Content.
Retrieve information about the current user:
Native - ovr_User_GetLoggedInUser()
Unity - Platform.User.GetLoggedInUser()
This method retrieves the unique ID, Oculus username, and a URL profile image for the current user. 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, please see ovr_User_GetOrgScopedID.
Retrieve a list of the user’s friends:
Native - ovr_User_GetLoggedInUserFriends()
Unity - Platform.User.GetLoggedInUserFriends()
Retrieves an array of users that are friends with the current user. The list of friends be ordered by presence, friends active within your app will be returned first.
If there are a large number of values being returned, you may need to call ovr_User_GetNextUserArrayPage and paginate the data.
Retrieve a list of the user’s friends and the room they are currently in:
Native - ovr_User_GetLoggedInUserFriendsAndRooms()
Unity - Platform.User.GetLoggedInUserFriendsAndRooms()
Retrieves an array of users who are friends and the ID of the room that they are currently in. The list of friends will be ordered by presence, friends active within your app will be returned 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:
Native - ovr_User_GetLoggedInUserRecentlyMetUsersAndRooms()
Unity - Platform.User.GetLoggedInUserRecentlyMetUsersAndRooms()
Returns a list of users who the logged-in user recently interacted with in your app. Interesting users, users who interact frequently or for a long duration, will be returned first. Oculus tracks the number of times users meet in VR, their most recent encounter, and the amount of time they spend together. Customize the results returned using UserOptions.
Retrieve information about a specified user:
Native - ovr_User_Get()
Unity - Platform.User.Get()This method retrieves the unique ID, Oculus username, and a URL profile image for a specified user. 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, please see ovr_User_GetOrgScopedID.
Retrieve the Org Scoped ID for a user:
Native - ovr_User_GetOrgScopedID()
Unity - Platform.User.GetOrgScopedID()
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.
Display user profile (Gear VR only):
Native - ovr_User_LaunchProfile()
Unity - Platform.User.LaunchProfile()
Launch a profile that displays the Oculus name, ID, online status, recent interactions, and mutual friends for a specified user. The modal also allows a friend request to be sent to the user.