DXUserClient
This class is responsible for making requests to the DX user API.
The DXUserClient
class allows your app to request the current user's profile, request the current user's friends, and search for other DX users, giving your app access to the DX social network.
You will need to enable the "Profile" and "Smart Search" scopes for your app in the developer dashboard before using the user API.
Properties
Singleton instance of DXUserClient
. You will access all the available DXUserClient
methods through this instance.
Methods
getProfile
Request the currently authenticated user's profile. It's unlikely that you will need to directly use this method, as the isAuthenticated method on DXAuthClient
will pass an instance of DXProfile
representing the current user.
Parameter | Type | Description |
completion |
| The closure that will be invoked once the request finishes. |
error |
| The error returned for an unsuccessful request. |
userProfile |
| An instance of |
getFriendProfiles
Request the current user's friends list. When running in sandbox mode, you can created friendship links between sandbox users in the developer dashboard, allowing you to create and test a social network in your app.
Parameter | Type | Description |
completion |
| The closure that will be invoked once the request finishes. |
error |
| The error returned for an unsuccessful request. |
friendProfiles |
| An array of |
searchUsers
Search for DX users by a search term. The search term will be compared against users' handle, first name, and last name. Supports pagination through the page
and limit
parameters.
Parameter | Type | Description |
searchTerm |
| What users will be searched by. |
page |
| At what page to return users, where the page length is determined by |
limit |
| The maximum number of users to return. |
completion |
| The closure that will be invoked once the request finishes. |
error |
| The error returned for an unsuccessful request. |
users |
| An array of |
searchRandomUsers
Request a number of random users. This is useful if you want to display a number of random profiles without requiring the user to search for them.
Parameter | Type | Description |
count |
| The number of random users to return. |
completion |
| The closure that will be invoked once the request finishes. |
error |
| The error returned for an unsuccessful request. |
users |
| An array of |
Last updated