Searching users
Through the WireApplicationManager you can search for Wire users by name or handle.
WireUser
The searchUsers method returns a List<WireUser> where each WireUser contains:
- id — The user's qualified identity (
QualifiedIdwith UUID + domain) - name — The user's display name
- handle — The user's unique handle/username (if available)
- teamId — The UUID of the team the user belongs to (if available)
- email — Not populated in search results
- deleted — Not populated in search results
Use Case: Search for a user by name
- Kotlin
- Java
val applicationManager = wireAppSdk.getApplicationManager()
val results: List<WireUser> = applicationManager.searchUsersSuspending(
query = "Alice",
domain = "wire.com",
numberOfResults = 25
)
results.forEach { user ->
println("Found: ${user.name} (@${user.handle})")
}
WireApplicationManager applicationManager = wireAppSdk.getApplicationManager();
List<WireUser> results = applicationManager.searchUsers(
"Alice",
"wire.com",
25
);
for (WireUser user : results) {
System.out.println("Found: " + user.name() + " (@" + user.handle() + ")");
}
About search results
The search query is automatically normalized before matching. This means that:
- All characters are converted to lowercase
- Diacritical marks (accents) are removed
For example:
"Björn"→"bjorn""Álice"→"alice"
This makes searches more flexible and user-friendly, especially for international names and handles.
Matching users are returned in the following priority order:
- Users whose normalized full handle exactly matches the query
- Users whose normalized full display name exactly matches the query
- Users whose normalized handle starts with the query
- Users whose normalized display name starts with the query
This ranking helps ensure that the most relevant results appear first.