Develop

Users package

Updated: Sep 4, 2026
The Platform SDK Users Package provides comprehensive user management and social relationship features. The package retrieves logged-in user information and profile data, queries user details by ID, and manages user blocking and unblocking flows.
Friend requests can be sent through dedicated flows, and user profiles can be displayed. The package manages user relationships and social connections, provides access to user metadata and social graph information, and is essential for social features and user identity management.

Before you begin

How to install

  1. Add the following to your project’s ./gradle/libs.versions.toml file:
     [libraries]
     # Existing lines
     users-kotlin = { module = "com.meta.horizon.platform.sdk:users-kotlin", version.ref = "horizonPlatformSdk" }
    
     dependencies {
         // Existing lines
         implementation(libs.users.kotlin)
     }
    
  2. In Android Studio, click File > Sync Project with Gradle Files to install the package.
  3. Click Build > Generate App Bundles or APKs > Generate APKs.
  4. In the “External Libraries” section of your project, confirm that these packages are listed.
     com.meta.horizon.platform.sdk:core-kotlin
     com.meta.horizon.platform.sdk:users-kotlin
    
    Now you can initialize the Platform SDK and use Users package functions in your app.

API reference

See the exact requests and responses in the Platform SDK Users Package.

Test this on Meta Spatial Simulator

The lookup APIs, such as get, getBlockedUsers, getLoggedInUserFriends, and getUserProof:
Test these APIs on Meta Spatial Simulator without a physical device. Sign in to the simulator first. When signed in, these APIs call the Meta backend and return real responses. When signed out, they return an authentication error rather than sample data.
getLinkedAccounts and sendAuthUrl:
These return a fixed response rather than evaluating what you send, so a call that would fail on a physical device can still succeed here. Confirm the decision itself on a physical device.
launchBlockFlow and launchUnblockFlow, which also persist the result:
These use a simulated dialog.
getAccessToken reads the token already injected into the request and never calls the backend, returning a placeholder when none is present. getLoggedInUser does call the backend when signed in, but signed out it returns an empty user. Both return those as successes rather than errors, so a signed-out run can look like it worked and fail later against the backend.