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

Users Class

Modifiers: final
This class provides methods to access information about the User. It allows you to retrieve a user's ID, access token, and org-scoped ID, as well as their friends list and recently met users. Additionally, it provides methods to launch various flows such as blocking, unblocking, reporting, and sending friend requests. It's useful when you need to manage user relationships or perform actions that require user authentication within your application.

Signature

class Users

Constructors

Users ()
Signature
constructor()
Returns
Users

Functions

get ( userId )
Retrieve the user with the given ID. This might fail if the ID is invalid or the user is blocked. NOTE: Users will have a unique ID per application.
Signature
suspend fun get(userId: String): User
Parameters
userId: String
Returns
User
The user with the given ID, or null if the ID is invalid or the user is blocked.
getAccessToken ()
Return an access token string for this user, suitable for making REST calls against graph.oculus.com.
Signature
suspend fun getAccessToken(): String
Returns
String
The access token string.
sendAuthUrl ( authUrl )
Allows apps to initiate a login flow using the Meta Horizon App on a mobile device. The auth_url will be sent to the Horizon Mobile App and the user will be redirected to the auth_url to complete the login flow.
Signature
suspend fun sendAuthUrl(authUrl: String): Intent
Parameters
authUrl: String
Returns
Intent
Intent - Returns an Intent that must be passed to Activity.startActivityForResult(Intent, int) (or similar) in order to send auth_url to Mobile app. The activity will prompt the user whether to allow sending auth_url.
Did you find this page helpful?