Users package
Updated: Oct 14, 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.
This is a Platform SDK feature requiring Data Use Checkup
To use this feature, you must complete a Data Use Checkup (DUC). The DUC ensures that you comply with Developer Policies. It requires an administrator from your team to certify that your use of user data aligns with platform guidelines. During development, a DUC you submit is approved automatically and gives your app provisional access. Submitting the app for review or enabling higher release channel limits permanently ends automatic approval, but features you already have keep working while their review runs (see When to submit a DUC). Test users can call these features before DUC approval, except getting the logged-in user, which needs the User ID or User Profile grant.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)
}
In Android Studio, click File > Sync Project with Gradle Files to install the package.
Click Build > Generate App Bundles or APKs > Generate APKs.
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.
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.